Re-add task timeout
This commit is contained in:
parent
9ccba6fba6
commit
22f87a74b2
@ -83,6 +83,14 @@ public class TaskManager
|
||||
}
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user