switch job running to callback style

This commit is contained in:
2016-04-29 16:44:30 -07:00
parent 21830c9eb0
commit d4d38255f6

View File

@@ -99,9 +99,7 @@ export default class Job extends events.EventEmitter {
_performJob(job) {
this.debug(`Starting job ${job._id}`);
return Bluebird.try(() => {
return this.workerFn(job._source.payload);
})
return Bluebird.fromCallback((cb) => this.workerFn(job._source.payload, cb))
.then((output) => {
const unknownMime = false;
const docOutput = {};