Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In redis cluster mode, ‘global:completed’ cannot be triggered #1927

Open
t86 opened this issue Dec 4, 2020 · 1 comment
Open

In redis cluster mode, ‘global:completed’ cannot be triggered #1927

t86 opened this issue Dec 4, 2020 · 1 comment
Labels

Comments

@t86
Copy link

t86 commented Dec 4, 2020

Description

There is no problem using the stand-alone redis, but after using example to configure redis as a cluster, the global: completed event cannot be triggered

var Queue = require('..')
var Redis = require('ioredis')

var videoQueue = new Queue('video transcoding', {
  prefix: '{prefix}',
  createClient: () => new Redis.Cluster([{
    host: "xxx.redis.rds.aliyuncs.com",
    port: 6379,
    password:'xxxx'
  }])
}, true);

videoQueue.on('global:completed', (jobId, data)=>{
  console.log('global complete', jobId, data)
})
videoQueue.on('completed', (res, data)=>{
  console.log('complete', res.id, data)
})
videoQueue.process(function(job, done){
  console.log('videoQueue job:', job.id);
  done(null, {message:'video 2'});
});

let index = 0
setInterval(()=> {
  videoQueue.add({category: index++}).then((res) => {
    console.log(JSON.stringify(res.id?res.id:res));
  });
},1000)

Bull version

3.18.1

@stale
Copy link

stale bot commented Jul 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 12, 2021
@manast manast added bug and removed wontfix labels Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants