customJobOptions or bullJobsOptions

Hello I have several tasks repeated and would like to delete them from Redis once they are finished. I found Bull's doc that asks to add removeOnComplete in the job options: https://docs.bullmq.io/guide/queues/auto-removal-of-jobs The problem is that I have the impression that Sapphire never takes this into account because of 2 different variable names. https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks/src/lib/ScheduledTaskHandler.ts#L55-L90 The createRepeated function calls the create function with a bullJobsOptions variable in the options, but create looks to see if a customJobOptions variable exists. The options are never applied because the bullJobsOptions variable is never read.
GitHub
plugins/packages/scheduled-tasks/src/lib/ScheduledTaskHandler.ts at...
Plugins for the Sapphire Framework. Contribute to sapphiredev/plugins development by creating an account on GitHub.
Solution:
released 8.0.0 @Zaros
Jump to solution
5 Replies
Favna
Favna14mo ago
@Zaros so based on @Dragonite ‘s code I believe it’s this way but I also have to honestly say that I never look in the redis instance. https://github.com/favware/dragonite/blob/main/src/scheduled-tasks/postStats.ts
GitHub
dragonite/src/scheduled-tasks/postStats.ts at main · favware/dragon...
A Pokémon information Discord bot built around Discord Interactions - favware/dragonite
Zaros
ZarosOP14mo ago
It doesn't work for me To correct this on my bot, I added this line just after creating my SapphireClient
container.tasks.client.jobsOpts.removeOnComplete = true
container.tasks.client.jobsOpts.removeOnComplete = true
Favna
Favna14mo ago
will release a fix soon @Zaros just waiting for CI checks to pass
Solution
Favna
Favna14mo ago
released 8.0.0 @Zaros
Zaros
ZarosOP14mo ago
thx!
Want results from more Discord servers?
Add your server