Bug fix: export with -J could fail when two files had the same content.

Exporting is done inside a call to writeLockDbWhile which guarantees there
is only one process uploading to a given ExportLocation.
This commit is contained in:
Joey Hess 2021-01-13 14:50:48 -04:00
parent fb921cd0b0
commit 6a30d04ece
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 8 additions and 1 deletions

View file

@ -283,7 +283,11 @@ performExport r db ek af contentsha loc allfilledvar = do
sent <- tryNonAsync $ case ek of
AnnexKey k -> ifM (inAnnex k)
( notifyTransfer Upload af $
upload' (uuid r) k af stdRetry $ \pm -> do
-- alwaysUpload because the same key
-- could be used for more than one export
-- location, and concurrently uploading
-- of the content should still be allowed.
alwaysUpload (uuid r) k af stdRetry $ \pm -> do
let rollback = void $
performUnexport r db [ek] loc
sendAnnex k rollback $ \f ->