Browse code

* 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

Michal Ludvig authored on 2009/10/06 12:24:16
Showing 2 changed files
... ...
@@ -1,5 +1,7 @@
1 1
 2009-10-06  Michal Ludvig  <mludvig@logix.net.nz>
2 2
 
3
+	* S3/S3.py: Introduce throttling on upload only after
4
+	  second failure. I.e. first retry at full speed.
3 5
 	* TODO: Updated with new ideas.
4 6
 
5 7
 2009-06-02  Michal Ludvig  <michal@logix.cz>
... ...
@@ -504,7 +504,8 @@ class S3(object):
504 504
 			if self.config.progress_meter:
505 505
 				progress.done("failed")
506 506
 			if retries:
507
-				throttle = throttle and throttle * 5 or 0.01
507
+				if retries < _max_retries:
508
+					throttle = throttle and throttle * 5 or 0.01
508 509
 				warning("Upload failed: %s (%s)" % (resource['uri'], e))
509 510
 				warning("Retrying on lower speed (throttle=%0.2f)" % throttle)
510 511
 				warning("Waiting %d sec..." % self._fail_wait(retries))