public RepeatingTimerTask Add(DateTime runAt, Func <DateTime> action, TimeSpan errorDelay) { if (action == null) { throw new ArgumentNullException("action"); } if (runAt.Subtract(DateTime.UtcNow) < MaxPassed) { throw new InvalidOperationException("runAt is too far in the past."); } var to = new RepeatingTimerTask(action, runAt, errorDelay); Add(to); return(to); }
public void Start() { _task = _taskSchedulerService.AddRepeatingTask(InternalCheckAuthExpiration); }
private void ReAddRepeatingTask(RepeatingTimerTask task) { // Reset the task. task.Reset(); Add(task); }