Search code examples
bull-queue

bull repeatable jobs left in Redis


I started using the repeatable jobs in bull and everything seems to be working well for me. However, I noticed that each iteration leaves a job in Redis:

  1. "test:foo:repeat:7a140b0cf5b3ee29cb164b7c9cc03bc3:1619132310000"
  2. "test:foo:repeat:7a140b0cf5b3ee29cb164b7c9cc03bc3:1619132280000"
  3. "test:foo:repeat:7a140b0cf5b3ee29cb164b7c9cc03bc3:1619132360000"

and the list keeps growing. I tried to do a job.remove() within the process function, but it threw an error... can't remove repeatable jobs I guess. I'm assuming these will eventually be cleaned up by Redis, but is there something more proactive I can do to keep Redis clean?


Solution

  • Needed to add the 'removeOnComplete' value to the jobOptions.