From 73e302fdf020a425dbe231f7323e7b15b1952dc6 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Mon, 25 Apr 2016 10:54:00 -0700 Subject: [PATCH] tweak the schema a bit --- src/helpers/create_index.js | 2 +- src/job.js | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/helpers/create_index.js b/src/helpers/create_index.js index fad7514..5c8edbb 100644 --- a/src/helpers/create_index.js +++ b/src/helpers/create_index.js @@ -1,7 +1,7 @@ var schema = { payload: { type: 'object', enabled: false }, priority: { type: 'short' }, - process_timeout: { type: 'long' }, + timeout: { type: 'long' }, process_expiration: { type: 'date' }, created_at: { type: 'date' }, started_at: { type: 'date' }, diff --git a/src/job.js b/src/job.js index 32d616d..c3b8508 100644 --- a/src/job.js +++ b/src/job.js @@ -18,21 +18,18 @@ export default class Job extends events.EventEmitter { this.type = type; this.payload = payload; this.timeout = timeout; - this.status = JOB_STATUS_PENDING; this.ready = createIndex(client, index) - .then((...args) => { + .then(() => { this.client.index({ index: this.index, type: this.type, body: { payload: this.payload, timeout: this.timeout, - created: new Date(), - started: null, - completed: null, + created_at: new Date(), attempts: 0, - status: this.status, + status: JOB_STATUS_PENDING, } }) .then((doc) => {