# DurableJobsOptions.ShouldRetry

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durablejobs/orleans.hosting.durablejobsoptions/) | [Properties](/orleans/docs/api/csharp/microsoft.orleans.durablejobs/orleans.hosting.durablejobsoptions/properties/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.DurableJobs/Hosting/DurableJobsOptions.cs)

```csharp
public Func<IJobRunContext, Exception, DateTimeOffset?> ShouldRetry
```

Gets or sets the function that determines whether a failed job should be retried and when. The function receives the job context and the exception that caused the failure, and returns the time when the job should be retried, or `null` if the job should not be retried. Default: Retry up to 5 times with exponential backoff (2^n seconds).
