diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-24 14:44:57 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-24 14:44:57 -0400 |
commit | 7b2bcfab392d387b89c3c251f0c9a8b9c0203aa8 (patch) | |
tree | d96e09b920b878538bddb7b1c46f186dde7c2242 /Role/User.hs | |
parent | 50da1dee420cc6071fe8697de25df49142cce8d5 (diff) | |
download | debug-me-7b2bcfab392d387b89c3c251f0c9a8b9c0203aa8.tar.gz |
better workaround for https://github.com/jaspervdj/websockets/issues/142
Diffstat (limited to 'Role/User.hs')
-rw-r--r-- | Role/User.hs | 8 |
1 files changed, 3 insertions, 5 deletions
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 |