2
0

Re-add task timeout

This commit is contained in:
glax 2023-06-27 22:19:06 +02:00
parent 9ccba6fba6
commit ba57282879

View File

@ -82,6 +82,14 @@ public class TaskManager
break;
}
}
foreach (TrangaTask timedOutTask in _allTasks
.Where(taskQuery => taskQuery.lastChange.Add(TimeSpan.FromMinutes(3)) < DateTime.Now))
{
if(timedOutTask is DownloadChapterTask dct)
_runningDownloadChapterTasks[dct].Cancel();
timedOutTask.state = TrangaTask.ExecutionState.Failed;
}
foreach (TrangaTask failedDownloadChapterTask in _allTasks.Where(taskQuery =>
taskQuery.state is TrangaTask.ExecutionState.Failed && taskQuery is DownloadChapterTask).ToArray())