Fix king bug validate-events

This commit is contained in:
Benjamin Summers 2019-12-12 19:00:35 -08:00
parent 25aa8c9fb6
commit b2526854e8

View File

@ -221,7 +221,9 @@ checkEvs pierPath first last = do
showEvents :: EventId -> EventId -> ConduitT ByteString Void (RIO e) ()
showEvents eId _ | eId > last = pure ()
showEvents eId cycle =
showEvents eId cycle = do
when (eId `mod` 10000 == 0) $ do
lift $ logTrace (display ("#" <> tshow eId))
await >>= \case
Nothing -> lift $ logTrace "Everything checks out."
Just bs -> do
@ -229,8 +231,9 @@ checkEvs pierPath first last = do
n <- io $ cueBSExn bs
when (eId > cycle) $ do
(mug, wen, evNoun) <- unpackJob n
fromNounErr evNoun &
either (logError . displayShow) pure
fromNounErr evNoun & \case
Left err -> logError (displayShow (eId, err))
Right (_ Ev) -> pure ()
showEvents (succ eId) cycle
unpackJob :: Noun -> RIO e (Mug, Wen, Noun)