Bull is not removing idle keys from Redis for completed/failed jobs
See original GitHub issueI read this issue https://github.com/taskforcesh/bullmq/issues/225 and added the options the remove jobs on complete and fail by default. Ended up with something like this:
const defaultJobOptions = { removeOnComplete: true, removeOnFail: true };
const channelQueue = new Queue("Channel", {
connection: redis,
defaultJobOptions: defaultJobOptions,
});
Then every time I need to add a new job, I’m just using that queue with the job options if necessary, i.e.
await channelQueue.add("syncAll", {}, { repeat: { cron: "15 * * * *" } });
If I look at the keys stored in Redis, I can find old/idle keys for completed jobs that are not being deleted
{
name: 'syncAll',
data: '{}',
opts: '{"attempts":0,"delay":3599963,"repeat":{"cron":"15 * * * *","count":2438},"jobId":"repeat:syncAll:cb9618d676fe6cb7fc182b28022e33bd:1619752500000","timestamp":1619748900037,"prevMillis":1619752500000}',
timestamp: '1619748900037',
delay: '0',
priority: '0',
processedOn: '1619752500200',
returnvalue: 'null',
finishedOn: '1619752500225'
}
I have a QueueScheduler too but doesn’t seem to have an option to add removeOn* behaviour
const channelScheduler = new QueueScheduler("Channel", { connection: redis });
await channelScheduler.waitUntilReady();
Is there anything missing on my config or it’s not working as expected?
I’m using bullmq “1.14.0”
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Bull is not removing idle keys from Redis for completed/failed ...
I read this issue https://github.com/taskforcesh/bullmq/issues/225 and added the options the remove jobs on complete and fail by default.
Read more >OptimalBits/bull - Gitter
i am facing a problem using bull with redis. on multiple job creation certain jobs are moving to completion without being processed. Can...
Read more >Welcome to Bull's Guide - GitHub Pages
When a job stalls, depending on the job settings the job can be retried by another idle worker or it can just move...
Read more >Ability to provide insights from Redis Bull Queue data
I'm fairly new to Redis and Bull, and I'm trying to figure out how to query this data (using Redis in Node. js)...
Read more >Troubleshooting - Amazon ElastiCache for Redis
Network ACLs are assigned to subnets, not specific resources. ... use of commands that act upon multiple values, keys, or data types must...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@jcalvento I tried to reproduce it using some tests without success 😦, maybe you can change something in these tests to reproduce the issue:
Hello,
We have the same issue (using bullmq 1.30.2). We set { removeOnComplete: true } in all our queues defaultJobOptions. It’s working fine for all jobs except those with repeat option. We define one QueueScheduler instance per queue with a dedicated Redis connection.