use transfer stages for copy --from
See commit e04a931439
for an explanation
of why move uses transfer stages for --from, but command stages for
--to. At the point of that commit, copy was actually already using
command stages for everything, so the commit was incorrect about
improving copy --to.
But, the same reasoning about --from applies to copy as to move; when
verification is not done incrementally, download and verification are
the main two stages. The cleanup stage for copy is even less work than
for move (it doesn't drop from the remote).
Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
579d9b60c1
commit
152be2948b
2 changed files with 8 additions and 13 deletions
|
@ -50,7 +50,7 @@ seek o = case fromToOptions o of
|
|||
Nothing -> giveup "Specify --from or --to"
|
||||
|
||||
seek' :: CopyOptions -> FromToHereOptions -> CommandSeek
|
||||
seek' o fto = startConcurrend stages $ do
|
||||
seek' o fto = startConcurrency (Command.Move.stages fto) $ do
|
||||
case batchOption o of
|
||||
NoBatch -> withKeyOptions
|
||||
(keyOptions o) (autoMode o) seeker
|
||||
|
@ -73,12 +73,6 @@ seek' o fto = startConcurrend stages $ do
|
|||
}
|
||||
keyaction = Command.Move.startKey fto Command.Move.RemoveNever
|
||||
|
||||
stages = case fto of
|
||||
FromOrToRemote (FromRemote _) -> commandStages
|
||||
FromOrToRemote (ToRemote _) -> commandStages
|
||||
ToHere -> commandStages
|
||||
FromRemoteToRemote _ _ -> transferStages
|
||||
|
||||
{- A copy is just a move that does not delete the source file.
|
||||
- However, auto mode avoids unnecessary copies, and avoids getting or
|
||||
- sending non-preferred content. -}
|
||||
|
|
|
@ -65,7 +65,7 @@ seek o = case fromToOptions o of
|
|||
Nothing -> giveup "Specify --from or --to"
|
||||
|
||||
seek' :: MoveOptions -> FromToHereOptions -> CommandSeek
|
||||
seek' o fto = startConcurrency stages $ do
|
||||
seek' o fto = startConcurrency (stages fto) $ do
|
||||
case batchOption o of
|
||||
NoBatch -> withKeyOptions (keyOptions o) False seeker
|
||||
(commandAction . keyaction)
|
||||
|
@ -83,14 +83,15 @@ seek' o fto = startConcurrency stages $ do
|
|||
FromRemoteToRemote _ _ -> Nothing
|
||||
, usesLocationLog = True
|
||||
}
|
||||
stages = case fto of
|
||||
FromOrToRemote (FromRemote _) -> transferStages
|
||||
FromOrToRemote (ToRemote _) -> commandStages
|
||||
ToHere -> transferStages
|
||||
FromRemoteToRemote _ _ -> transferStages
|
||||
keyaction = startKey fto (removeWhen o)
|
||||
ww = WarnUnmatchLsFiles
|
||||
|
||||
stages :: FromToHereOptions -> UsedStages
|
||||
stages (FromOrToRemote (FromRemote _)) = transferStages
|
||||
stages (FromOrToRemote (ToRemote _)) = commandStages
|
||||
stages ToHere = transferStages
|
||||
stages (FromRemoteToRemote _ _) = transferStages
|
||||
|
||||
start :: FromToHereOptions -> RemoveWhen -> SeekInput -> RawFilePath -> Key -> CommandStart
|
||||
start fromto removewhen si f k = start' fromto removewhen afile si k ai
|
||||
where
|
||||
|
|
Loading…
Add table
Reference in a new issue