Bull: TypeError: scripts.updateDelaySet(...).then(...).catch(...).

Created on 17 Aug 2018  路  3Comments  路  Source: OptimalBits/bull

Description

I am trying re-use Redis session following PATTERNS.md. All is working until the "New Queue" code, but when I try call ".process" queue method i exception appears

_TypeError: scripts.updateDelaySet(...).then(...).catch(...).return is not a function
services_monitor.1.wfdxm3rsmh11@l01752papp0 | at delayUpdate (/var/www/html/node/node_modules/bull/lib/queue.js:867:16)_

Minimal, Working Test code to reproduce the issue.

The code:
`var Queue = require('bull');

var Redis = require('ioredis')
var client = new Redis(6379, 'redis');
var subscriber = new Redis(6379, 'redis');

var opts = {
createClient: function (type) {
switch (type) {
case 'client':
return client;
case 'subscriber':
return subscriber;
default:
return new Redis();
}
}
}`

var queueMonitor = new Queue('monitor', opts); //-> returns the Queue object
queueMonitor.process(function(job, done){ // the error appears here
console.log("Received message", job.data.msg);
done();
});

Bull version

bull 3.4.7
ioredis 4.0.0

Additional information

Most helpful comment

I believe this is an issue with ioredis v4.0.0
Did you try:
var Redis = require('ioredis');
Redis.Promise = require('bluebird');

All 3 comments

I believe this is an issue with ioredis v4.0.0
Did you try:
var Redis = require('ioredis');
Redis.Promise = require('bluebird');

@ritter It works!! Tkss 馃憤

I didn't want to use bluebird to solve this, so downgrading ioredis version from ^4.2.0 to 3.2.2 worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thelinuxlich picture thelinuxlich  路  3Comments

chocof picture chocof  路  3Comments

inn0vative1 picture inn0vative1  路  4Comments

JSRossiter picture JSRossiter  路  3Comments

sarneeh picture sarneeh  路  3Comments