Comment on page
Sure, here's an example of how to include retry attempts using the NextCron API:
To add retry attempts to your job, you can include the "attempts" option in your job configuration. The value of "attempts" should be an integer representing the number of retry attempts you want to allow for the job.
Here's an example payload that includes a job configuration with 3 retry attempts:
import axios from 'axios';
In this example, the job topic is "import-post", the target is "http://localhost:3000/api/v1/hello", and the HTTP method is "POST". The "attempts" option is set to 3, which means that the job will be retried up to 3 times if it fails.
You can customize the retry logic further by including a "backoff" option, which determines the delay between each retry attempt. By default, the delay increases exponentially with each attempt, but you can customize this behavior by including a "backoff" option with your desired configuration.
If a job exceeds the maximum number of retry attempts and still fails, it will be marked as failed and you will be notified via email, as long as you have configured email notifications in your account settings.