diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-31 02:34:03 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-31 02:34:03 -0400 |
commit | acec36711090577752532a39f472e734e6b67fdb (patch) | |
tree | 6a3a5de0ec092e19c28464f4e2703fda9571b264 /Assistant/TransferSlots.hs | |
parent | 661eda766a8aa5c548ad89d8360bd4219eea138b (diff) |
where indentation
Diffstat (limited to 'Assistant/TransferSlots.hs')
-rw-r--r-- | Assistant/TransferSlots.hs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Assistant/TransferSlots.hs b/Assistant/TransferSlots.hs index 80a062e36..8039c561d 100644 --- a/Assistant/TransferSlots.hs +++ b/Assistant/TransferSlots.hs @@ -54,20 +54,20 @@ runTransferThread (Just (t, info, a)) = do runTransferThread' :: AssistantData -> IO () -> IO () runTransferThread' d a = go - where - go = catchPauseResume a - pause = catchPauseResume $ runEvery (Seconds 86400) noop - {- Note: This must use E.try, rather than E.catch. - - When E.catch is used, and has called go in its exception - - handler, Control.Concurrent.throwTo will block sometimes - - when signaling. Using E.try avoids the problem. -} - catchPauseResume a' = do - r <- E.try a' :: IO (Either E.SomeException ()) - case r of - Left e -> case E.fromException e of - Just PauseTransfer -> pause - Just ResumeTransfer -> go - _ -> done + where + go = catchPauseResume a + pause = catchPauseResume $ runEvery (Seconds 86400) noop + {- Note: This must use E.try, rather than E.catch. + - When E.catch is used, and has called go in its exception + - handler, Control.Concurrent.throwTo will block sometimes + - when signaling. Using E.try avoids the problem. -} + catchPauseResume a' = do + r <- E.try a' :: IO (Either E.SomeException ()) + case r of + Left e -> case E.fromException e of + Just PauseTransfer -> pause + Just ResumeTransfer -> go _ -> done - done = flip runAssistant d $ - flip MSemN.signal 1 <<~ transferSlots + _ -> done + done = flip runAssistant d $ + flip MSemN.signal 1 <<~ transferSlots |