From 9d2ac4d87dc98bd2ab60da38a7e98f0964fd1595 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Sep 2017 12:12:11 -0400 Subject: lock to avoid more than one export to a remote at a time This commit was sponsored by Jack Hill on Patreon. --- Command/Export.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Command/Export.hs') diff --git a/Command/Export.hs b/Command/Export.hs index 22ea72170..a9f474a19 100644 --- a/Command/Export.hs +++ b/Command/Export.hs @@ -23,6 +23,7 @@ import Types.Remote import Types.Export import Annex.Content import Annex.CatFile +import Annex.LockFile import Logs.Location import Logs.Export import Database.Export @@ -85,7 +86,10 @@ seek o = do r <- getParsed (exportRemote o) unlessM (isExportSupported r) $ giveup "That remote does not support exports." + withExclusiveLock (gitAnnexExportLock (uuid r)) (seek' o r) +seek' :: ExportOptions -> Remote -> CommandSeek +seek' o r = do new <- fromMaybe (giveup "unknown tree") <$> -- Dereference the tree pointed to by the branch, commit, -- or tag. -- cgit v1.2.3