diff --git a/package.json b/package.json index 324ce03..4d1ad12 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "esqueue", - "version": "0.2.1", - "description": "", + "version": "0.2.2", + "description": "Job queue, powered by Elasticsearch", "main": "lib/index.js", "scripts": { "build": "rm -rf lib && babel src --out-dir lib", @@ -11,6 +11,12 @@ "unit": "nyc --require babel-core/register mocha test/src/**" }, "author": "Joe Fleming (https://github.com/w33ble)", + "keywords": [ + "job", + "queue", + "worker", + "elasticsearch" + ], "repository": { "type": "git", "url": "https://github.com/w33ble/esqueue.git" diff --git a/src/job.js b/src/job.js index 5a81cbb..1a53e1e 100644 --- a/src/job.js +++ b/src/job.js @@ -36,6 +36,7 @@ export default class Job extends events.EventEmitter { payload: this.payload, priority: this.priority, timeout: this.timeout, + process_expiration: new Date(0), // use epoch so the job query works created_at: new Date(), attempts: 0, max_attempts: this.maxAttempts, diff --git a/src/worker.js b/src/worker.js index 07f289f..d90587a 100644 --- a/src/worker.js +++ b/src/worker.js @@ -26,6 +26,7 @@ export default class Job extends events.EventEmitter { this.debug = (...msg) => debug(...msg, `id: ${this.id}`); this._checker = false; + this.debug(`Created worker for type ${this.type}`); this._startJobPolling(); } @@ -118,7 +119,8 @@ export default class Job extends events.EventEmitter { const workerOutput = new Promise((resolve, reject) => { resolve(this.workerFn.call(null, job._source.payload)); - setTimeout(function () { + setTimeout(() => { + this.debug(`Timeout processing job ${job._id}`); reject(new WorkerTimeoutError({ timeout: job._source.timeout, jobId: job._id,