avoid closeDb opening the db if it's not already open
This commit is contained in:
parent
b144622d0d
commit
fcc9eea554
1 changed files with 3 additions and 1 deletions
|
@ -151,7 +151,9 @@ openDb createdb _ = catchPermissionDenied permerr $ withExclusiveLock gitAnnexKe
|
|||
- data to it.
|
||||
-}
|
||||
closeDb :: Annex ()
|
||||
closeDb = liftIO . closeDbHandle =<< getDbHandle
|
||||
closeDb = Annex.getState Annex.keysdbhandle >>= \case
|
||||
Nothing -> return ()
|
||||
Just h -> liftIO (closeDbHandle h)
|
||||
|
||||
addAssociatedFile :: Key -> TopFilePath -> Annex ()
|
||||
addAssociatedFile k f = runWriterIO $ SQL.addAssociatedFile (toIKey k) f
|
||||
|
|
Loading…
Add table
Reference in a new issue