mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
more testing
This commit is contained in:
@@ -2,7 +2,6 @@ const Emitter = require('events');
|
||||
const debug = require('debug')('jambonz:feature-server');
|
||||
const assert = require('assert');
|
||||
const {TaskPreconditions} = require('../utils/constants');
|
||||
const hooks = require('../utils/notifiers');
|
||||
const specs = new Map();
|
||||
const _specData = require('./specs');
|
||||
for (const key in _specData) {specs.set(key, _specData[key]);}
|
||||
@@ -28,7 +27,9 @@ class Task extends Emitter {
|
||||
|
||||
async exec(cs) {
|
||||
this.cs = cs;
|
||||
const {actionHook, notifyHook} = hooks(this.logger, cs.callInfo);
|
||||
|
||||
// N.B. need to require it down here rather than at top to avoid recursion in require of this module
|
||||
const {actionHook, notifyHook} = require('../utils/notifiers')(this.logger, cs.callInfo);
|
||||
this.actionHook = actionHook;
|
||||
this.notifyHook = notifyHook;
|
||||
}
|
||||
@@ -55,7 +56,7 @@ class Task extends Emitter {
|
||||
if (this.action) {
|
||||
const tasks = await this.actionHook(this.action, method, auth, results);
|
||||
if (tasks && Array.isArray(tasks)) {
|
||||
this.logger.debug(`${this.name} replacing application with ${tasks.length} tasks`);
|
||||
this.logger.debug({tasks: tasks}, `${this.name} replacing application with ${tasks.length} tasks`);
|
||||
this.callSession.replaceApplication(tasks);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user