SVN: toys/rsget.pl/RSGet/Get.pm

sparky sparky at pld-linux.org
Thu Mar 3 04:06:13 CET 2011


Author: sparky
Date: Thu Mar  3 04:06:13 2011
New Revision: 12182

Modified:
   toys/rsget.pl/RSGet/Get.pm
Log:
- multi() will delay if called too many times


Modified: toys/rsget.pl/RSGet/Get.pm
==============================================================================
--- toys/rsget.pl/RSGet/Get.pm	(original)
+++ toys/rsget.pl/RSGet/Get.pm	Thu Mar  3 04:06:13 2011
@@ -315,7 +315,11 @@
 {
 	my $self = shift;
 	my $msg = shift || "multi-download not allowed";
-	return $self->wait( \&start, - irand( 60, 300 ), $msg, "multi" );
+	if ( ++$self->{_try} < 4 ) {
+		return $self->wait( \&start, - irand( 30, 120 ), $msg, "multi" );
+	} else {
+		return $self->delay( 300, $msg );
+	}
 }
 
 # TODO: make delay interface-aware


More information about the pld-cvs-commit mailing list