Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public void Start()
 {
     _task = _taskSchedulerService.AddRepeatingTask(InternalCheckAuthExpiration);
 }
Esempio n. 3
0
 private void ReAddRepeatingTask(RepeatingTimerTask task)
 {
     // Reset the task.
     task.Reset();
     Add(task);
 }