fix crash after drop in v10
After cleaning up the lock file, the content directory is gone, so freezing it failed. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
d0a5714409
commit
76e365769e
1 changed files with 6 additions and 6 deletions
|
@ -243,8 +243,8 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock
|
|||
cleanuplockfile lockfile
|
||||
liftIO $ dropLock h
|
||||
-- We have an exclusive lock, so no other process can have
|
||||
-- the file locked, and so it's safe to remove it, as long
|
||||
-- as all attempts to lock the file use checkSaneLock.
|
||||
-- the lock file locked, and so it's safe to remove it, as
|
||||
-- long as all lock attempts use checkSaneLock.
|
||||
_ -> do
|
||||
maybe noop cleanuplockfile mlockfile
|
||||
liftIO $ dropLock lck
|
||||
|
@ -258,10 +258,10 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock
|
|||
maybe noop cleanuplockfile mlockfile
|
||||
#endif
|
||||
|
||||
cleanuplockfile lockfile = modifyContent lockfile $
|
||||
void $ liftIO $ tryIO $ do
|
||||
removeWhenExistsWith R.removeLink lockfile
|
||||
cleanObjectDirs lockfile
|
||||
cleanuplockfile lockfile = void $ tryNonAsync $ do
|
||||
thawContentDir lockfile
|
||||
liftIO $ removeWhenExistsWith R.removeLink lockfile
|
||||
liftIO $ cleanObjectDirs lockfile
|
||||
|
||||
{- Runs an action, passing it the temp file to get,
|
||||
- and if the action succeeds, verifies the file matches
|
||||
|
|
Loading…
Add table
Reference in a new issue