assist: With --jobs, parallelize transferring content to/from remotes
authorJoey Hess <joeyh@joeyh.name>
Wed, 5 Jul 2023 16:24:04 +0000 (12:24 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 5 Jul 2023 16:47:30 +0000 (12:47 -0400)
Command.Add.seek starts concurrency with CommandStages. And for
Command.Sync, it needs TransferStages. So, to get both types of concurrency
for the two different parts, it either needs to change the type of
concurrency in between, or just call startConcurrency once for each.

It seems safe enough to call startConcurrency twice, because it does shut
down concurrency (mostly) at the end, and eg the old Annex.workers get
emptied.

Sponsored-by: unqueued on Patreon
CHANGELOG
Command/Assist.hs
Command/Sync.hs
doc/bugs/__39__git_annex_assist__39___doesn__39__t_honor_--jobs.mdwn

index eb9878da7a9a829e8ea8e43504eee1adc27f5e48..448dd62c4e3e970a2b195fb0304f62557117e3dd 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,7 @@ git-annex (10.20230627) UNRELEASED; urgency=medium
   * reinject: Added --guesskeys option.
   * diffdriver: Added --text option for easy diffing of the contents of
     annexed text files.
+  * assist: With --jobs, parallelize transferring content to/from remotes.
 
  -- Joey Hess <id@joeyh.name>  Mon, 26 Jun 2023 13:10:40 -0400
 
index acf73f5f524977708acab0f93d441985ab94e9e5..bcdac9ae679ab552d201803a0bf6dd5c6c9744af 100644 (file)
@@ -21,7 +21,7 @@ cmd = withAnnexOptions [jobsOption, backendOption] $
                (myseek <--< Command.Sync.optParser Command.Sync.AssistMode)
 
 myseek :: Command.Sync.SyncOptions -> CommandSeek
-myseek o = startConcurrency transferStages $ do
+myseek o = do
        -- Changes to top of repository, so when this is run in a
        -- subdirectory, it will still default to adding files anywhere in
        -- the working tree.
@@ -35,7 +35,7 @@ myseek o = startConcurrency transferStages $ do
                , Command.Add.checkGitIgnoreOption = CheckGitIgnore True
                , Command.Add.dryRunOption = DryRun False
                }
-       waitForAllRunningCommandActions
+       finishCommandActions
        -- Flush added files to index so they will be committed.
        Annex.Queue.flush
 
index 91b68819111cbf059e7aad483a29f6908b70575d..42fa2468242494174e908602671a613882a65c5d 100644 (file)
@@ -260,10 +260,10 @@ seek o = do
        
        prepMerge
        
-       startConcurrency transferStages (seek' o)
+       seek' o
 
 seek' :: SyncOptions -> CommandSeek
-seek' o = do
+seek' o = startConcurrency transferStages $ do
        let withbranch a = a =<< getCurrentBranch
 
        remotes <- syncRemotes (syncWith o)
index 10e3152036e6fd352e20acb9d99dc926192c2fd6..8ef89034ef7ee1563c187997a1c111cba03b98f3 100644 (file)
@@ -32,3 +32,5 @@ local repository version: 10
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
 git-annex is **marvellous** and a game-changer for all my workflows 👍
+
+> [[fixed|done]] --[[Joey]]