我使用的是来自https://www.npmjs.com/package/bullmq页面的最基本的示例(const queue = new Queue('Paint')) -一切正常(默认为localhost:6379)。
但是,当我添加一个基于对Redis (rediss://...)的TLS访问的连接(new Queue('Paint', { connection }))时,我仍然可以将作业推入队列(我在Redis中看到了这一点),但是这些作业都不会被worker拉出。
也许我遗漏了一些隐藏的旗帜?
谢谢!
-Dror
发布于 2021-09-04 17:44:04
发布于 2021-12-01 22:11:03
这是由于对redis url的手动解析和不完整造成的:https://github.com/OptimalBits/bull/blob/develop/lib/queue.js#L308
rediss:// vs redis://根本没有考虑到。
为了解决这个问题,我不得不向额外的'redis‘键添加更多的键:
export const REDIS_CONNECTION: Redis.RedisOptions = {
...(REDIS_URL.startsWith('rediss://') ? { tls: {} } : null), // This trick makes sure SSL would work
retryStrategy: (times) => {
// reconnect after
return Math.min(times * 50, 2000);
},
};
export const queue = new Bull<JobData>('foobar', REDIS_URL, {
redis: REDIS_CONNECTION,
...https://stackoverflow.com/questions/69029132
复制相似问题