Skip to content

Commit

Permalink
Merge df65df8 into ed138c6
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 15, 2019
2 parents ed138c6 + df65df8 commit 2d839bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/index.js
Expand Up @@ -385,9 +385,14 @@ class Generator extends EventEmitter {
queueMethod(method, methodName, queueName, reject = () => {}) {
const self = this;
queueName = queueName || 'default';
debug(`Queueing ${methodName} in ${queueName}`);
let namespace = '';
if (self.options && self.options.namespace) {
namespace = self.options.namespace;
}

debug(`Queueing ${namespace}#${methodName} in ${queueName}`);
self.env.runLoop.add(queueName, completed => {
debug(`Running ${methodName}`);
debug(`Running ${namespace}#${methodName}`);
self.emit(`method:${methodName}`);

runAsync(function() {
Expand All @@ -396,7 +401,7 @@ class Generator extends EventEmitter {
})()
.then(completed)
.catch(err => {
debug(`An error occured while running ${methodName}`, err);
debug(`An error occured while running ${namespace}#${methodName}`, err);

// Ensure we emit the error event outside the promise context so it won't be
// swallowed when there's no listeners.
Expand Down

0 comments on commit 2d839bf

Please sign in to comment.