Merge branch 'hotfix/2.0.2'
This commit is contained in:
commit
c165a8e2e6
@ -36,9 +36,14 @@ namespace Tapeti.Flow.Default
|
|||||||
await FlowStateLock.DeleteFlowState();
|
await FlowStateLock.DeleteFlowState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsStoredOrDeleted()
|
||||||
|
{
|
||||||
|
return storeCalled || deleteCalled;
|
||||||
|
}
|
||||||
|
|
||||||
public void EnsureStoreOrDeleteIsCalled()
|
public void EnsureStoreOrDeleteIsCalled()
|
||||||
{
|
{
|
||||||
if (!storeCalled && !deleteCalled)
|
if (!IsStoredOrDeleted())
|
||||||
throw new InvalidProgramException("Neither Store nor Delete are called for the state of the current flow. FlowID = " + FlowStateLock?.FlowID);
|
throw new InvalidProgramException("Neither Store nor Delete are called for the state of the current flow. FlowID = " + FlowStateLock?.FlowID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,9 @@ namespace Tapeti.Flow.Default
|
|||||||
|
|
||||||
if (flowContext?.FlowStateLock != null)
|
if (flowContext?.FlowStateLock != null)
|
||||||
{
|
{
|
||||||
if (consumeResult == ConsumeResult.Error)
|
if (!flowContext.IsStoredOrDeleted())
|
||||||
|
// The exception strategy can set the consume result to Success. Instead, check if the yield point
|
||||||
|
// was handled. The flow provider ensures we only end up here in case of an exception.
|
||||||
await flowContext.FlowStateLock.DeleteFlowState();
|
await flowContext.FlowStateLock.DeleteFlowState();
|
||||||
|
|
||||||
flowContext.FlowStateLock.Dispose();
|
flowContext.FlowStateLock.Dispose();
|
||||||
|
Loading…
Reference in New Issue
Block a user