-
Couldn't load subscription status.
- Fork 5
Timeout removePathForcibly in moduleWorkspace
#92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9b00685 to
7a3250b
Compare
7a3250b to
cdbc1a4
Compare
removePathForcibly in moduleWorkspace
| GHC.withFrozenCallStack $ do | ||
| result <- try (liftIO (IO.timeout (5 * 1000) (IO.removePathForcibly ws))) | ||
| case result of | ||
| Right (Just ()) -> return () | ||
| Right Nothing -> pure () | ||
| Left (_ :: IOException) -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability could be improved here:
| GHC.withFrozenCallStack $ do | |
| result <- try (liftIO (IO.timeout (5 * 1000) (IO.removePathForcibly ws))) | |
| case result of | |
| Right (Just ()) -> return () | |
| Right Nothing -> pure () | |
| Left (_ :: IOException) -> do | |
| GHC.withFrozenCallStack $ do | |
| catch | |
| (timeout (5_000) (liftIO $ IO.removePathForcibly ws)) | |
| $ \(_ :: IOException) -> do |
from lifted-base: catch, timeout.
5 ms seems to be not much here. I'd increase it an order of magnitude, just to be on the safe side.
| Left (_ :: IOException) -> do | ||
| if retries > 0 | ||
| then do | ||
| liftIO (IO.threadDelay 100000) -- wait 100ms before retrying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: use lifted-base:
| liftIO (IO.threadDelay 100000) -- wait 100ms before retrying | |
| threadDelay 100_000 -- wait 100ms before retrying |
No description provided.