fixed the tests for task service (#384)

* fixed the tests for task service
This commit is contained in:
Leila Lali
2017-06-15 12:49:20 -07:00
committed by GitHub
parent 9b91a93578
commit d9e68831ab
4 changed files with 43 additions and 23 deletions

View File

@@ -71,12 +71,12 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
/// <summary>
/// Starts the task and monitor the task progress
/// </summary>
public async Task Run()
public async Task RunAsync()
{
TaskStatus = SqlTaskStatus.InProgress;
await TaskToRun(this).ContinueWith(task =>
{
if (task.IsCompleted)
if (task.IsCompleted && !task.IsCanceled && !task.IsFaulted)
{
TaskResult taskResult = task.Result;
TaskStatus = taskResult.TaskStatus;
@@ -96,6 +96,14 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
});
}
//Run Task synchronously
public void Run()
{
RunAsync().ContinueWith(task =>
{
});
}
/// <summary>
/// Returns true if task has any messages
/// </summary>