From 91bdc03515a111ebd54eb77438b6f1ddc81da569 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Wed, 10 Apr 2024 07:19:08 +0300 Subject: [PATCH] debug --- hbs2-fixer/app/Main.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hbs2-fixer/app/Main.hs b/hbs2-fixer/app/Main.hs index 229378ff..a13caf95 100644 --- a/hbs2-fixer/app/Main.hs +++ b/hbs2-fixer/app/Main.hs @@ -56,6 +56,8 @@ import System.Exit qualified as Exit import Data.Cache qualified as Cache import Data.Cache (Cache) +import System.Exit + {- HLINT ignore "Functor law" -} @@ -166,7 +168,9 @@ withApp cfgPath action = do client <- lift $ race (pause @'Seconds 1) (newMessagingUnix False 1.0 soname) >>= orThrowUser ("can't connect to" <+> pretty soname) - void $ ContT $ withAsync $ runMessagingUnix client + mess <- ContT $ bracket (async $ runMessagingUnix client) $ \_ -> error "FUCK!" >> liftIO exitFailure + + link mess peerAPI <- makeServiceCaller @PeerAPI (fromString soname) refLogAPI <- makeServiceCaller @RefLogAPI (fromString soname) @@ -181,10 +185,12 @@ withApp cfgPath action = do void $ ContT $ withAsync $ liftIO $ runReaderT (runServiceClientMulti endpoints) client - let o = [MUWatchdog 20, MUDontRetry] + let o = [MUWatchdog 20] clientN <- newMessagingUnixOpts o False 1.0 soname - void $ ContT $ withAsync $ runMessagingUnix clientN + notif <- ContT $ bracket (async $ runMessagingUnix clientN) (\_ -> error "FUCK2" >> liftIO exitFailure) + + link notif sink <- newNotifySink