diff --git a/plutus-chain-index/src/Plutus/ChainIndex/App.hs b/plutus-chain-index/src/Plutus/ChainIndex/App.hs index ece014ce7d..870d8bfd10 100644 --- a/plutus-chain-index/src/Plutus/ChainIndex/App.hs +++ b/plutus-chain-index/src/Plutus/ChainIndex/App.hs @@ -88,11 +88,11 @@ runMain logConfig config = do syncChainIndex config runReq syncHandler (trace :: Trace IO (PrettyObject SyncLog), _) <- setupTrace_ logConfig "chain-index" - withAsync (runLogEffects (convertLog PrettyObject trace) $ logProgress chan) wait - - let port = show (Config.cicPort config) - putStrLn $ "Starting webserver on port " <> port - putStrLn $ "A Swagger UI for the endpoints are available at " - <> "http://localhost:" <> port <> "/swagger/swagger-ui" - Server.serveChainIndexQueryServer (Config.cicPort config) runReq + withAsync (runLogEffects (convertLog PrettyObject trace) $ logProgress chan) $ \logAsync -> do + let port = show (Config.cicPort config) + putStrLn $ "Starting webserver on port " <> port + putStrLn $ "A Swagger UI for the endpoints are available at " + <> "http://localhost:" <> port <> "/swagger/swagger-ui" + Server.serveChainIndexQueryServer (Config.cicPort config) runReq + wait logAsync