Bug Fix: Indicate failed task if waiting
If using ScheduledTaskStatus.WaitUntilFinished, only return true if the task completed successfully.
This commit is contained in:
1 parent
a5e38406d1
commit
f3351af9e8
1 file changed
+7
-1
@@ -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