Re-add task timeout
This commit is contained in:
parent
9ccba6fba6
commit
ba57282879
@ -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 =>
|
foreach (TrangaTask failedDownloadChapterTask in _allTasks.Where(taskQuery =>
|
||||||
taskQuery.state is TrangaTask.ExecutionState.Failed && taskQuery is DownloadChapterTask).ToArray())
|
taskQuery.state is TrangaTask.ExecutionState.Failed && taskQuery is DownloadChapterTask).ToArray())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user