git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@462
c11ca15a-4712-0410-83d8-
924469b57eb5
### TODO: incomplete.
if ($why =~ /.* wait (\d+) second/) {
- my $sleep = $1;
- &status("targettoofast: going to sleep for $sleep...");
- sleep $sleep;
+ my $sleep = $1;
+ my $max = 10;
+
+ if ($sleep > $max) {
+ &status("targettoofast: going to sleep for $max ($sleep)...");
+ $sleep = $max;
+ } else {
+ &status("targettoofast: going to sleep for $sleep");
+ }
+
+ my $delta = time() - ($cache{sleepTime} || 0);
+ if ($delta > $max+2) {
+ sleep $sleep;
+ $cache{sleepTime} = time();
+ }
+
} else {
if (!exists $cache{TargetTooFast}) {
&DEBUG("on_ttf: failed: $why");