purify exportActions
Purifying exportActions will allow introspecting and modifying it, which is needed to add progress bar display to it. Only S3 and WebDAV ran an Annex action while constructing ExportActions. There was a small performance gain from them doing that, since a resource was able to be prepared and reused for multiple actions by Command.Export. As seen in commit809cfbbd8a
and5d394023eb
S3 and WebDAV actually create a new handle for each access in normal, non-export use. It doesn't seem worth making export use of them marginally more efficient than normal use. It would be better to do that work upfront when constructing the remote. Or perhaps use a MVar to cache a handle. This commit was sponsored by Nick Piper on Patreon.
This commit is contained in:
parent
5d394023eb
commit
9cebfd7002
11 changed files with 143 additions and 148 deletions
|
@ -691,7 +691,6 @@ seekExportContent rs (currbranch, _) = or <$> forM rs go
|
|||
where
|
||||
go r = withExclusiveLock (gitAnnexExportLock (Remote.uuid r)) $ do
|
||||
db <- Export.openDb (Remote.uuid r)
|
||||
ea <- Remote.exportActions r
|
||||
exported <- case remoteAnnexExportTracking (Remote.gitconfig r) of
|
||||
Nothing -> nontracking r
|
||||
Just b -> do
|
||||
|
@ -699,9 +698,9 @@ seekExportContent rs (currbranch, _) = or <$> forM rs go
|
|||
case mcur of
|
||||
Nothing -> nontracking r
|
||||
Just cur -> do
|
||||
Command.Export.changeExport r ea db cur
|
||||
Command.Export.changeExport r db cur
|
||||
return [mkExported cur []]
|
||||
Export.closeDb db `after` fillexport r ea db (exportedTreeishes exported)
|
||||
Export.closeDb db `after` fillexport r db (exportedTreeishes exported)
|
||||
|
||||
nontracking r = do
|
||||
exported <- getExport (Remote.uuid r)
|
||||
|
@ -720,10 +719,9 @@ seekExportContent rs (currbranch, _) = or <$> forM rs go
|
|||
_ -> noop
|
||||
|
||||
|
||||
fillexport _ _ _ [] = return False
|
||||
fillexport r ea db (t:[]) =
|
||||
Command.Export.fillExport r ea db t
|
||||
fillexport r _ _ _ = do
|
||||
fillexport _ _ [] = return False
|
||||
fillexport r db (t:[]) = Command.Export.fillExport r db t
|
||||
fillexport r _ _ = do
|
||||
warnExportConflict r
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue