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 False
|
||||
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)
|
||||
False -> update paid [PrintAcknowledgeProcessed =. True] >> return oks
|
||||
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
|
||||
-- | Monadic if-then-else.
|
||||
ifM :: Monad m => m Bool -> m a -> m a -> m a
|
||||
ifM c m m' =
|
||||
do b <- c
|
||||
if b then m else m'
|
||||
ifM c x y = c >>= bool y x
|
||||
|
||||
-- | @ifNotM mc = ifM (not <$> mc)@ from Agda.Utils.Monad
|
||||
ifNotM :: Monad m => m Bool -> m a -> m a -> m a
|
||||
|
||||
Loading…
Reference in New Issue
Block a user