@@ -559,31 +559,29 @@ wait m = waitAsync (const mzero) Nothing m
559logged :: (Loggable a, MonadIO m) => AsyncT m a -> AsyncT m a
559logged :: (Loggable a, MonadIO m) => AsyncT m a -> AsyncT m a
560logged m = AsyncT $ do
560logged m = AsyncT $ do
561 ctx <- get
561 ctx <- get
562− case logsRef ctx of
565+ case logsRef ctx of
563− Nothing -> runAsyncT m
566+ Nothing -> runAsyncT m
568+ put $ ctx {journal = CtxLog (Executing : ls) []}
571+ -- replaying the log
572+ CtxLog ls (r:rs) -> do
573+ -- dbg $ "Replay: j: " ++ show j
576+ put $ ctx {journal = CtxLog (r : ls) rs}
564− Just _ -> runLogged ctx (runAndLogResult m)
577+ runAndLogResult m
579+ let x = fmap read val
580+ put $ ctx {journal = CtxLog (r : ls) rs}
568− runLogged ctx action =
572− put $ ctx {journal = CtxLog (Executing : ls) []}
575− -- replaying the log
576− CtxLog ls (r:rs) -> do
577− -- dbg $ "Replay: j: " ++ show j
580− put $ ctx {journal = CtxLog (r : ls) rs}
583− let x = fmap read val
584− put $ ctx {journal = CtxLog (r : ls) rs}
587 runAndLogResult action = runAsyncT $ do
585 runAndLogResult action = runAsyncT $ do
588 x <- action
586 x <- action
589 logResult x
587 logResult x