Open
Description
Hello, and thank you for a great tool!
I'm trying to achieve two goals:
- All failed jobs must be transitioned to deleted state
- Retries must happen only for specific exception types
I tried the flowing:
GlobalJobFilters.Filters.Remove(typeof(AutomaticRetryAttribute));
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute()
{
OnAttemptsExceeded = AttemptsExceededAction.Delete,
OnlyOn = [ typeof(OperationCanceledException) ]
});
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute()
{
Attempts = 0,
OnAttemptsExceeded = AttemptsExceededAction.Delete
});
Retry works but jobs with other types of errors goes to "Failed" state instead of "Deleted".
Then I tried the following:
GlobalJobFilters.Filters.Remove(typeof(AutomaticRetryAttribute));
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute()
{
Attempts = 0,
OnAttemptsExceeded = AttemptsExceededAction.Delete
});
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute()
{
OnAttemptsExceeded = AttemptsExceededAction.Delete,
OnlyOn = [ typeof(OperationCanceledException) ]
});
In this case all failed jobs goes to deleted without any retry.
I guess the problem is that only one instance of each attribute type is enabled?
Metadata
Metadata
Assignees
Labels
No labels