Update queue index while enqueueing jobs to the top of queue
This commit is contained in:
parent
bc43680202
commit
7d24ce671b
3
NEWS.md
3
NEWS.md
@ -3,6 +3,9 @@
|
||||
## 1.44.2
|
||||
Released 2017-mm-dd
|
||||
|
||||
Bug fixes:
|
||||
- Update queue index while enqueueing jobs to the top of queue.
|
||||
|
||||
|
||||
## 1.44.1
|
||||
Released 2017-04-04
|
||||
|
@ -63,7 +63,17 @@ JobQueue.prototype.dequeue = function (user, callback) {
|
||||
|
||||
JobQueue.prototype.enqueueFirst = function (user, jobId, callback) {
|
||||
debug('JobQueue.enqueueFirst user=%s, jobId=%s', user, jobId);
|
||||
this.metadataBackend.redisCmd(QUEUE.DB, 'RPUSH', [ QUEUE.PREFIX + user, jobId ], callback);
|
||||
this.metadataBackend.redisMultiCmd(QUEUE.DB, [
|
||||
[ 'RPUSH', QUEUE.PREFIX + user, jobId ],
|
||||
[ 'SADD', QUEUE.INDEX, user ]
|
||||
], function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
this.jobPublisher.publish(user);
|
||||
callback();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user