Restore settled mutation and streaming regression behavior
This commit is contained in:
parent
8be285c57f
commit
15515230fa
1 changed files with 44 additions and 35 deletions
|
|
@ -991,12 +991,13 @@ dispatchAndFinalize env user root rec timeoutFailure dispatch = do
|
|||
dispatch
|
||||
case dispatchOutcome of
|
||||
Nothing -> pure (Left timeoutFailure)
|
||||
Just (Left dispatchFailure) -> pure (Left dispatchFailure)
|
||||
Just (Right ()) -> do
|
||||
Just dispatchResult -> do
|
||||
settled <- withTransaction (envDb env) $ \conn ->
|
||||
markExternalSettled conn rec
|
||||
if not settled
|
||||
then pure (Right MutationPending)
|
||||
then pure $ case dispatchResult of
|
||||
Left dispatchFailure -> Left dispatchFailure
|
||||
Right () -> Right MutationPending
|
||||
else do
|
||||
observed <- observeObject (envS3 env) (mrObjectKey rec)
|
||||
finalized <- withTransaction (envDb env) $ \conn ->
|
||||
|
|
@ -1006,9 +1007,10 @@ dispatchAndFinalize env user root rec timeoutFailure dispatch = do
|
|||
cacheInvalidatePrefixes (envRedis env) (suUserId user) root
|
||||
(listCacheAncestorPrefixes (mrRelativePath rec))
|
||||
pure (Right MutationSucceeded)
|
||||
Just MutationFailed -> pure (Right MutationFailed)
|
||||
Just other -> pure (Right other)
|
||||
Nothing -> pure (Right MutationPending)
|
||||
result -> pure $ case (dispatchResult, result) of
|
||||
(Left dispatchFailure, _) -> Left dispatchFailure
|
||||
(Right (), Just mutationResult) -> Right mutationResult
|
||||
(Right (), Nothing) -> Right MutationPending
|
||||
|
||||
observeObject :: S3 -> ObjectKey -> IO ObjectObservation
|
||||
observeObject s3 key = do
|
||||
|
|
|
|||
Loading…
Reference in a new issue