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:
Joey Hess 2015-05-19 23:46:42 -04:00
parent 9de5cd2966
commit 87f28bb2ea

View file

@ -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