summaryrefslogtreecommitdiff
path: root/Utility/Metered.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-27 18:52:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-27 18:56:32 -0400
commitf6e7037c0ccdf646d1ca955c48cece814f5700a4 (patch)
tree035070a47d5bac76e36271507a09aea23ef3ee12 /Utility/Metered.hs
parent300935948503d671ad91b943787d71dc1f6e421e (diff)
resume interrupted chunked downloads
Leverage the new chunked remotes to automatically resume downloads. Sort of like rsync, although of course not as efficient since this needs to start at a chunk boundry. But, unlike rsync, this method will work for S3, WebDAV, external special remotes, etc, etc. Only directory special remotes so far, but many more soon! This implementation will also properly handle starting a download from one remote, interrupting, and resuming from another one, and so on. (Resuming interrupted chunked uploads is similarly doable, although slightly more expensive.) This commit was sponsored by Thomas Djärv.
Diffstat (limited to 'Utility/Metered.hs')
-rw-r--r--Utility/Metered.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Utility/Metered.hs b/Utility/Metered.hs
index bca7f58e7..cc07f9c35 100644
--- a/Utility/Metered.hs
+++ b/Utility/Metered.hs
@@ -88,7 +88,7 @@ meteredWriteFile meterupdate f b = withBinaryFile f WriteMode $ \h ->
{- Applies an offset to a MeterUpdate. This can be useful when
- performing a sequence of actions, such as multiple meteredWriteFiles,
- - that all update a common meter progressively.
+ - that all update a common meter progressively. Or when resuming.
-}
offsetMeterUpdate :: MeterUpdate -> BytesProcessed -> MeterUpdate
offsetMeterUpdate base offset = \n -> base (offset `addBytesProcessed` n)