1
0
mirror of synced 2024-11-22 01:13:49 +00:00

Fixed exception in Tapeti.Transient when message arrives after the timeout

This commit is contained in:
Mark van Renswoude 2021-09-09 15:11:44 +02:00
parent f16921d12d
commit fb6aa19884

View File

@ -42,7 +42,7 @@ namespace Tapeti.Transient
return; return;
if (map.TryRemove(continuationID, out var tcs)) if (map.TryRemove(continuationID, out var tcs))
tcs.SetResult(context.Message); tcs.TrySetResult(context.Message);
} }
@ -86,7 +86,7 @@ namespace Tapeti.Transient
private void TimeoutResponse(object tcs) private void TimeoutResponse(object tcs)
{ {
((TaskCompletionSource<object>)tcs).SetException(new TimeoutException("Transient RequestResponse timed out at (ms) " + defaultTimeoutMs)); ((TaskCompletionSource<object>)tcs).TrySetException(new TimeoutException("Transient RequestResponse timed out at (ms) " + defaultTimeoutMs));
} }
} }
} }