Only run next queued task if the previous was successful
This commit is contained in:
parent
5baaaac22d
commit
f4f763f136
|
|
@ -41,7 +41,15 @@ namespace Microsoft.AspNetCore.Sockets
|
||||||
return _lastQueuedTask;
|
return _lastQueuedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
var newTask = _lastQueuedTask.ContinueWith((t, s1) => taskFunc(s1), state).Unwrap();
|
var newTask = _lastQueuedTask.ContinueWith((t, s1) =>
|
||||||
|
{
|
||||||
|
if (t.IsFaulted || t.IsCanceled)
|
||||||
|
{
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
return taskFunc(s1);
|
||||||
|
},
|
||||||
|
state).Unwrap();
|
||||||
_lastQueuedTask = newTask;
|
_lastQueuedTask = newTask;
|
||||||
return newTask;
|
return newTask;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue