Bug Fix: Indicate failed task if waiting
If using ScheduledTaskStatus.WaitUntilFinished, only return true if the task completed successfully.
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user