use the queue doctype in the worker by default

allow the user to override the setting
This commit is contained in:
2017-05-23 17:59:49 -07:00
parent 283731d6e6
commit d4f24182b4

View File

@@ -54,7 +54,10 @@ export default class Esqueue extends events.EventEmitter {
}
registerWorker(type, workerFn, opts) {
const worker = new Worker(this, type, workerFn, opts);
const options = Object.assign({
doctype: this.settings.doctype,
}, opts);
const worker = new Worker(this, type, workerFn, options);
this._workers.push(worker);
return worker;
}