summaryrefslogtreecommitdiffstats
path: root/lib/ASM
diff options
context:
space:
mode:
authorLibravatarDoug Freed <dwfreed@mtu.edu>2016-07-07 20:22:56 -0700
committerLibravatarDoug Freed <dwfreed@mtu.edu>2016-07-07 20:22:56 -0700
commit473ba634a02c159eda2a56ad15b53a38c2024984 (patch)
tree59971cb814c24bc00ac1e07b76662e7dda9facd3 /lib/ASM
parent35ece0052466897368c883614369f376e9ba1127 (diff)
Don't run /stats p in 90 seconds if ratelimited
The ratelimit handler already schedules one in 30 seconds, so don't schedule a second one in 90 seconds.
Diffstat (limited to 'lib/ASM')
-rw-r--r--lib/ASM/Statsp.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ASM/Statsp.pm b/lib/ASM/Statsp.pm
index a309e13..a83f55c 100644
--- a/lib/ASM/Statsp.pm
+++ b/lib/ASM/Statsp.pm
@@ -25,6 +25,7 @@ sub new
}
my $clearstatsp = 1;
+my $ratelimited = 0;
my %statsp = ();
my %oldstatsp = ();
@@ -63,7 +64,8 @@ sub on_endofstats
}
# $event->{args}->[2] == "End of /STATS report"
#end of /stats p
- $conn->schedule( 90, sub { $conn->sl('STATS p') } );
+ $conn->schedule( 90, sub { $conn->sl('STATS p') } ) unless $ratelimited;
+ $ratelimited = 0;
}
}
@@ -71,6 +73,7 @@ sub on_whofuckedup
{
my ($conn, $event) = @_;
if ($event->{args}->[1] eq "STATS") {
+ $ratelimited = 1;
$conn->schedule(30, sub { $conn->sl('STATS p') } );
}
}