Class DelayCalculator
Inheritance
System.Object
Namespace: Umbraco.Cms.Infrastructure.BackgroundJobs
Assembly: Umbraco.Infrastructure.dll
Syntax
public class DelayCalculator
Methods
View SourceGetDelay(String, ICronTabParser, ILogger, TimeSpan)
Determines the delay before the first run of a recurring task implemented as a hosted service when an optonal configuration for the first run time is available.
Declaration
public static TimeSpan GetDelay(string firstRunTime, ICronTabParser cronTabParser, ILogger logger, TimeSpan defaultDelay)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | firstRunTime | The configured time to first run the task in crontab format. |
| ICronTabParser | cronTabParser | An instance of ICronTabParser |
| ILogger | logger | The logger. |
| System.TimeSpan | defaultDelay | The default delay to use when a first run time is not configured. |
Returns
| Type | Description |
|---|---|
| System.TimeSpan | The delay before first running the recurring task. |