Exemplo n.º 1
0
        private void ResetScheduledTasks()
        {
            var now = CurrentRequestData.Now;
            var hungScheduledTasks = _taskSettingManager.GetInfo()
                                     .Where(
                task => task.Enabled &&
                (task.Status == TaskExecutionStatus.AwaitingExecution ||
                 task.Status == TaskExecutionStatus.Executing || task.Status == TaskExecutionStatus.Failed) &&
                (task.LastStarted < now.AddMinutes(-15) || task.LastStarted == null)
                )
                                     .ToList();

            foreach (var task in hungScheduledTasks)
            {
                _taskSettingManager.Reset(task.Type, false);
            }
        }
Exemplo n.º 2
0
 public void Reset(TaskUpdateData info)
 {
     _taskSettingManager.Reset(info.Type, true);
 }