From 46319044f813ddfe689273084a1864f861edeb4e Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 4 Aug 2022 17:07:50 +0100 Subject: [PATCH] core: fix race condition in --execute option, closes #890 (#898) --- src/Simplex/Chat/Core.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Chat/Core.hs b/src/Simplex/Chat/Core.hs index b58f4857de..597b524e27 100644 --- a/src/Simplex/Chat/Core.hs +++ b/src/Simplex/Chat/Core.hs @@ -32,8 +32,8 @@ runSimplexChat :: ChatOpts -> User -> ChatController -> (User -> ChatController runSimplexChat ChatOpts {maintenance} u cc chat | maintenance = wait =<< async (chat u cc) | otherwise = do - a1 <- async $ chat u cc - a2 <- runReaderT (startChatController u True) cc + a1 <- runReaderT (startChatController u True) cc + a2 <- async $ chat u cc waitEither_ a1 a2 sendChatCmd :: ChatController -> String -> IO ChatResponse