mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-06-12 06:47:53 +02:00
Added force shutdown functionality and option to select wether we want to force or not
This commit is contained in:
@ -85,10 +85,18 @@ public class TaskManager
|
||||
return this._chapterCollection.Keys.ToArray();
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
public void Shutdown(bool force = false)
|
||||
{
|
||||
_continueRunning = false;
|
||||
ExportTasks(Directory.GetCurrentDirectory());
|
||||
|
||||
if(force)
|
||||
Environment.Exit(_allTasks.Count(task => task.isBeingExecuted));
|
||||
|
||||
//Wait for tasks to finish
|
||||
while(_allTasks.Any(task => task.isBeingExecuted))
|
||||
Thread.Sleep(10);
|
||||
|
||||
}
|
||||
|
||||
private HashSet<TrangaTask> ImportTasks(string importFolderPath)
|
||||
|
Reference in New Issue
Block a user