* feat: als

* fix: up test timeout

* fix: don't overwrite caller if it already exists

* fix: up test timeout for psql
This commit is contained in:
Barış Soner Uşaklı
2021-08-30 10:23:38 -04:00
committed by GitHub
parent 156ba0958e
commit e59d357533
6 changed files with 19 additions and 3 deletions

View File

@@ -96,6 +96,10 @@ Hooks.fire = async function (hook, params) {
winston.warn(`[plugins] Unknown hookType: ${hookType}, hook : ${hook}`);
return;
}
if (params && typeof params === 'object' && !params.hasOwnProperty('caller')) {
const als = require('../als');
params.caller = als.getStore();
}
const result = await hookTypeToMethod[hookType](hook, hookList, params);
if (hook !== 'action:plugins.firehook' && hook !== 'filter:plugins.firehook') {