optimisation for borg
Skip needing to list importable contents when unchanged since last time.
This commit is contained in:
parent
e1ac42be77
commit
4f9969d0a1
9 changed files with 32 additions and 21 deletions
|
@ -325,13 +325,13 @@ seekRemote remote branch msubdir importcontent ci = do
|
|||
listContents :: Remote -> ImportTreeConfig -> CheckGitIgnore -> TVar (Maybe (ImportableContents (ContentIdentifier, Remote.ByteSize))) -> CommandStart
|
||||
listContents remote importtreeconfig ci tvar = starting "list" ai si $
|
||||
listContents' remote importtreeconfig ci $ \importable -> do
|
||||
liftIO $ atomically $ writeTVar tvar (Just importable)
|
||||
liftIO $ atomically $ writeTVar tvar importable
|
||||
next $ return True
|
||||
where
|
||||
ai = ActionItemOther (Just (Remote.name remote))
|
||||
si = SeekInput []
|
||||
|
||||
listContents' :: Remote -> ImportTreeConfig -> CheckGitIgnore -> (ImportableContents (ContentIdentifier, Remote.ByteSize) -> Annex a) -> Annex a
|
||||
listContents' :: Remote -> ImportTreeConfig -> CheckGitIgnore -> (Maybe (ImportableContents (ContentIdentifier, Remote.ByteSize)) -> Annex a) -> Annex a
|
||||
listContents' remote importtreeconfig ci a =
|
||||
makeImportMatcher remote >>= \case
|
||||
Right matcher -> tryNonAsync (getImportableContents remote importtreeconfig ci matcher) >>= \case
|
||||
|
|
|
@ -495,13 +495,14 @@ importThirdPartyPopulated remote =
|
|||
void $ includeCommandAction $ starting "list" ai si $
|
||||
Command.Import.listContents' remote ImportTree (CheckGitIgnore False) go
|
||||
where
|
||||
go importable = importKeys remote ImportTree False True importable >>= \case
|
||||
go (Just importable) = importKeys remote ImportTree False True importable >>= \case
|
||||
Just importablekeys -> do
|
||||
(_imported, updatestate) <- recordImportTree remote ImportTree importablekeys
|
||||
next $ do
|
||||
updatestate
|
||||
return True
|
||||
Nothing -> next $ return False
|
||||
go Nothing = next $ return True -- unchanged from before
|
||||
|
||||
ai = ActionItemOther (Just (Remote.name remote))
|
||||
si = SeekInput []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue