ignore failure to clean up stale transfer lock file
Perhaps due to permissions problem, or perhaps a race with another process also cleaning up.
This commit is contained in:
parent
9de5cd2966
commit
87f28bb2ea
1 changed files with 9 additions and 7 deletions
|
@ -145,13 +145,15 @@ checkTransfer t = do
|
|||
StatusNoLockFile -> return Nothing
|
||||
StatusUnLocked -> do
|
||||
-- Take a non-blocking lock while deleting
|
||||
-- the stale lock file.
|
||||
r <- tryLockExclusive Nothing lck
|
||||
case r of
|
||||
Just lockhandle -> do
|
||||
cleanstale
|
||||
dropLock lockhandle
|
||||
_ -> noop
|
||||
-- the stale lock file. Ignore failure
|
||||
-- due to permissions problems, races, etc.
|
||||
void $ tryIO $ do
|
||||
r <- tryLockExclusive Nothing lck
|
||||
case r of
|
||||
Just lockhandle -> do
|
||||
cleanstale
|
||||
dropLock lockhandle
|
||||
_ -> noop
|
||||
return Nothing
|
||||
#else
|
||||
v <- liftIO $ lockShared $ transferLockFile tfile
|
||||
|
|
Loading…
Reference in a new issue