get, move, copy, mirror: Concurrent downloads and uploads are now supported!

This works, and seems fairly robust. Clean get of 20 files at -J3. At -J10,
there are some messages about ssh multiplexing, probably due to a race
spinning up the ssh connection cacher. But, it manages to get all the files
ok regardless.

The progress bars are a scrambled mess though, due to bugs in
ascii-progress, which I've already filed. Particularly this one:
https://github.com/yamadapc/haskell-ascii-progress/issues/8
This commit is contained in:
Joey Hess 2015-04-10 17:08:07 -04:00
parent 75b6b5cbc7
commit 8077ccbd54
14 changed files with 138 additions and 13 deletions

View file

@ -389,7 +389,7 @@ syncFile rs f k = do
u <- getUUID
let locs' = concat [[u | got], putrs, locs]
-- Using callCommandAction rather than commandAction for drops,
-- Using callCommandAction rather than includeCommandAction for drops,
-- because a failure to drop does not mean the sync failed.
handleDropsFrom locs' rs "unwanted" True k (Just f)
Nothing callCommandAction
@ -403,7 +403,7 @@ syncFile rs f k = do
( return [ get have ]
, return []
)
get have = commandAction $ do
get have = includeCommandAction $ do
showStart "get" f
next $ next $ getViaTmp k $ \dest -> getKeyFile' k (Just f) dest have
@ -415,7 +415,7 @@ syncFile rs f k = do
, return []
)
put dest = do
ok <- commandAction $ do
ok <- includeCommandAction $ do
showStart "copy" f
Command.Move.toStart' dest False (Just f) k
return (ok, if ok then Just (Remote.uuid dest) else Nothing)