I’m working on a project where I have different types of scheduled jobs, some of which run very frequently (every minute) while others run less often. I’m trying to implement a retry strategy that takes into account the job’s schedule. Here’s what I’m aiming for:
- For jobs that run every minute, I don’t want any retries as a new instance of the job will run soon anyway.
- For less frequent jobs, I want same retry mechanism.
Currently, I’m using the following attribute on my job method:
[AutomaticRetry(OnAttemptsExceeded = AttemptsExceededAction.Delete)]
Is there a way to implement conditional retry logic within a single job method based on the job’s schedule? Ideally, I’d like to:
Disable retries for jobs where jobruns every minute.
Any guidance or best practices for implementing this kind of conditional retry logic would be greatly appreciated!
Thank you in advance for your help!