core: fix race condition in --execute option, closes #890 (#898)

This commit is contained in:
Evgeny Poberezkin
2022-08-04 17:07:50 +01:00
committed by GitHub
parent 8a7e320d12
commit 46319044f8

View File

@@ -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