Scheduled Task retry failed job

I want to make it so that if there’s an error when running the delayed task, it gets delayed according to a backoff strategy. However, in the current code of the library, this isn’t possible because of code in run method of ScheduledTaskHandler. Is there any way to fix this? corresponding line that blocks re-trying failed jobs: upd. maybe not that line, I don’t know exactly what the methods of Result do
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:
merged. Will release when CI is done then post to #Announcements
Jump to solution
5 Replies
AbyssKitty
AbyssKittyOP2w ago
for temp use i changed this code but prob need something better(?)
const value = result.unwrapOrElse((error) => { throw error; });
const value = result.unwrapOrElse((error) => { throw error; });
Favna
Favna2w ago
Uhm I don't know how to best fix this but if you can suggest a change through PR to the library that would be much appreciated because I think one of my bots could really use it as well.
AbyssKitty
AbyssKittyOP2w ago
GitHub
fix(ScheduledTaskHandler): Throw task error on run if present by De...
Required for working backoff strategy; Probably not the best way to do it, but it works
Favna
Favna2w ago
left a review comment @AbyssKitty
Solution
Favna
Favna2w ago
merged. Will release when CI is done then post to #Announcements

Did you find this page helpful?