cleanup, job property storage

This commit is contained in:
2016-04-18 16:39:07 -07:00
parent fb4caf4dc1
commit 4416a5508d
2 changed files with 17 additions and 5 deletions

View File

@@ -8,12 +8,24 @@ export default class Job extends events.EventEmitter {
super();
queue.client.index({
index: queue.index,
type: type,
this.queue = queue;
this.type = type;
this.payload = payload;
this.timeout = options.timeout || 10000;
this.ready = this.queue.client.index({
index: this.queue.index,
type: this.type,
body: Object.assign({}, options, {
payload: payload
})
})
.then((doc) => {
this.document = {
id: doc._id,
type: doc._type,
version: doc._version,
};
});
}
}