From 7b2bcfab392d387b89c3c251f0c9a8b9c0203aa8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 24 Apr 2017 14:44:57 -0400 Subject: better workaround for https://github.com/jaspervdj/websockets/issues/142 --- Role/User.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Role/User.hs') diff --git a/Role/User.hs b/Role/User.hs index 1d1702e..49c263c 100644 --- a/Role/User.hs +++ b/Role/User.hs @@ -27,12 +27,11 @@ import System.Environment run :: UserOpts -> IO ExitCode run os = do (cmd, cmdparams) <- shellCommand os - go cmd cmdparams startSession + fromMaybe (ExitFailure 101) <$> go cmd cmdparams startSession where go cmd cmdparams startmsg = do putStr "Connecting to debug-me server..." hFlush stdout - esv <- newEmptyTMVarIO runClientApp $ clientApp (InitMode mempty) User developerMessages $ \ichan ochan sid -> do let url = sessionIDUrl sid "localhost" 8081 putStrLn "" @@ -43,9 +42,8 @@ run os = do uthread <- async (user startmsg p ichan ochan) exitstatus <- waitForProcess ph cancel uthread - atomically $ putTMVar esv exitstatus - sessionDone - fromMaybe (ExitFailure 101) <$> atomically (tryReadTMVar esv) + sessionDone + return exitstatus developerMessages :: LogMessage -> Maybe (Message Entered) developerMessages (Developer m) = Just m -- cgit v1.2.3