fix(print): apc ident aliases did not stop at first success
This commit is contained in:
parent
60644528fc
commit
b7d4f6913d
@ -47,7 +47,7 @@ dispatchJobPrintAck = JobHandlerException act
|
|||||||
return True
|
return True
|
||||||
_ -> return False
|
_ -> return False
|
||||||
procOneId oks Entity{entityKey=paid, entityVal=PrintAcknowledge{printAcknowledgeApcIdent=Text.strip -> apci, printAcknowledgeTimestamp=ackt}} =
|
procOneId oks Entity{entityKey=paid, entityVal=PrintAcknowledge{printAcknowledgeApcIdent=Text.strip -> apci, printAcknowledgeTimestamp=ackt}} =
|
||||||
andM [ackOneId ackt $ ftrans apci | ftrans <- ftransAliases] >>= \case
|
orM [ackOneId ackt $ ftrans apci | ftrans <- ftransAliases] >>= \case
|
||||||
True -> delete paid >> return (succ oks)
|
True -> delete paid >> return (succ oks)
|
||||||
False -> update paid [PrintAcknowledgeProcessed =. True] >> return oks
|
False -> update paid [PrintAcknowledgeProcessed =. True] >> return oks
|
||||||
apcis <- selectList [PrintAcknowledgeProcessed ==. False] [Asc PrintAcknowledgeTimestamp, LimitTo jobPrintAckChunkSize]
|
apcis <- selectList [PrintAcknowledgeProcessed ==. False] [Asc PrintAcknowledgeTimestamp, LimitTo jobPrintAckChunkSize]
|
||||||
|
|||||||
@ -1161,9 +1161,7 @@ guardMOnM b x = guardM b *> x
|
|||||||
-- Some Utility Functions from Agda.Utils.Monad
|
-- Some Utility Functions from Agda.Utils.Monad
|
||||||
-- | Monadic if-then-else.
|
-- | Monadic if-then-else.
|
||||||
ifM :: Monad m => m Bool -> m a -> m a -> m a
|
ifM :: Monad m => m Bool -> m a -> m a -> m a
|
||||||
ifM c m m' =
|
ifM c x y = c >>= bool y x
|
||||||
do b <- c
|
|
||||||
if b then m else m'
|
|
||||||
|
|
||||||
-- | @ifNotM mc = ifM (not <$> mc)@ from Agda.Utils.Monad
|
-- | @ifNotM mc = ifM (not <$> mc)@ from Agda.Utils.Monad
|
||||||
ifNotM :: Monad m => m Bool -> m a -> m a -> m a
|
ifNotM :: Monad m => m Bool -> m a -> m a -> m a
|
||||||
|
|||||||
Reference in New Issue
Block a user