HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.31k stars 1.69k forks source link

scheduled jobs retry forever #1983

Open rgamage opened 2 years ago

rgamage commented 2 years ago

Scheduled job that fails, with AutomaticRetry = 1 or 0, retries forever. After it fails, it is queued again, and again, every minute or so forever. Why is this? What's going on?

rangga98 commented 2 years ago

Hey @rgamage you can write on your startup class like this: GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute() { Attempts = 0 }); this code means that if your job fail, it will not retry