From 293a02bb59f3b1d083e3f505fce84277769fa4af Mon Sep 17 00:00:00 2001 From: ludvigm Date: Tue, 6 Oct 2009 03:24:16 +0000 Subject: [PATCH] * S3/S3.py: Introduce throttling on upload only after second failure. I.e. first retry at full speed. git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@397 830e0280-6d2a-0410-9c65-932aecc39d9d --- ChangeLog | 2 ++ S3/S3.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 08d1a85..ac15b5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-10-06 Michal Ludvig + * S3/S3.py: Introduce throttling on upload only after + second failure. I.e. first retry at full speed. * TODO: Updated with new ideas. 2009-06-02 Michal Ludvig diff --git a/S3/S3.py b/S3/S3.py index 950d5ed..f3c9632 100644 --- a/S3/S3.py +++ b/S3/S3.py @@ -504,7 +504,8 @@ def send_file(self, request, file, labels, throttle = 0, retries = _max_retries) if self.config.progress_meter: progress.done("failed") if retries: - throttle = throttle and throttle * 5 or 0.01 + if retries < _max_retries: + throttle = throttle and throttle * 5 or 0.01 warning("Upload failed: %s (%s)" % (resource['uri'], e)) warning("Retrying on lower speed (throttle=%0.2f)" % throttle) warning("Waiting %d sec..." % self._fail_wait(retries))