diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2014-08-11 22:59:00 +0400 |
---|---|---|
committer | Kenneth Skovhede <kenneth@hexad.dk> | 2014-08-11 22:59:00 +0400 |
commit | 01c64e1b9d04c27ff9305e6ba6089d1ee6b88b42 (patch) | |
tree | e452a5094bd9e0318365668960d15a7c76eb4896 /Duplicati/Server/Program.cs | |
parent | 96462d786668599b7caab23e80d49aafdbf0a092 (diff) |
Improved the worker thread to prevent crashes of the worker on Windows.v2.0.0.56-2.0_preview_2014-08-11
Diffstat (limited to 'Duplicati/Server/Program.cs')
-rw-r--r-- | Duplicati/Server/Program.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Duplicati/Server/Program.cs b/Duplicati/Server/Program.cs index f55bd7cbb..067d1da13 100644 --- a/Duplicati/Server/Program.cs +++ b/Duplicati/Server/Program.cs @@ -408,10 +408,11 @@ namespace Duplicati.Server }, LiveControl.State == LiveControls.LiveControlState.Paused);
Program.Scheduler = new Scheduler(WorkThread);
- Program.WorkThread.StartingWork += new EventHandler(SignalNewEvent);
- Program.WorkThread.CompletedWork += new EventHandler(SignalNewEvent);
- Program.WorkThread.WorkQueueChanged += new EventHandler(SignalNewEvent);
+ Program.WorkThread.StartingWork += (worker, task) => { SignalNewEvent(null, null); };
+ Program.WorkThread.CompletedWork += (worker, task) => { SignalNewEvent(null, null); };
+ Program.WorkThread.WorkQueueChanged += (worker) => { SignalNewEvent(null, null); };
Program.Scheduler.NewSchedule += new EventHandler(SignalNewEvent);
+ Program.WorkThread.OnError += (worker, task, exception) => { Program.DataConnection.LogError(task == null ? null : task.BackupID, "Error in worker", exception); };
Program.WebServer = new WebServer.Server(commandlineOptions);
|