Bug Fix: Indicate failed task if waiting

If using ScheduledTaskStatus.WaitUntilFinished, only return true if the
task completed successfully.
This commit is contained in:
Gary Sharp
2014-05-25 16:21:33 +10:00
parent a5e38406d1
commit f3351af9e8
+7 -1
View File
@@ -363,7 +363,13 @@ namespace Disco.Services.Tasks
} }
public bool WaitUntilFinished(TimeSpan Timeout) public bool WaitUntilFinished(TimeSpan Timeout)
{ {
return this._tcs.Task.Wait(Timeout); var finished = this._tcs.Task.Wait(Timeout);
// Return false if task completed, but with an error
if (finished)
return this.TaskException == null;
else
return false;
} }
#endregion #endregion