fix case where keys db was not initialized in time
When the keys db is opened for read, and did not exist yet, it used to
skip creating it, and return mempty values. But that prevents
reconcileStaged from populating associated files information in time for
the read. This fixes the one remaining case I know of where
the fix in a56b151f90
didn't work.
Note that, when there is a permissions error, it still avoids creating
the db and returns mempty for all queries. This does mean that
reconcileStaged does not run and so it may want to drop files that it
should not. However, presumably a permissions error on the keys database
also means that the user does not have permission to delete annex
objects, so they won't be able to drop the files anyway.
Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
a56b151f90
commit
f46e4c9b7c
2 changed files with 15 additions and 19 deletions
|
@ -44,8 +44,9 @@ wantDrop d from key file others = do
|
|||
others' <- case others of
|
||||
Just afs -> pure (filter (/= file) afs)
|
||||
Nothing -> case key of
|
||||
Just k -> mapM (\f -> AssociatedFile . Just <$> fromRepo (fromTopFilePath f))
|
||||
=<< Database.Keys.getAssociatedFiles k
|
||||
Just k ->
|
||||
mapM (\f -> AssociatedFile . Just <$> fromRepo (fromTopFilePath f))
|
||||
=<< Database.Keys.getAssociatedFiles k
|
||||
Nothing -> pure []
|
||||
l <- filterM checkwant others'
|
||||
if null l
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue