From 1b274f2ff5d2d62b4de643cf1201da889c4cd730 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Thu, 26 Nov 2015 12:34:10 +0400 Subject: Ignore lag for 2 minutes after a netsplit --- lib/ASM/Event.pm | 6 ++++-- meta.pl | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ASM/Event.pm b/lib/ASM/Event.pm index b1f9db6..c85313c 100644 --- a/lib/ASM/Event.pm +++ b/lib/ASM/Event.pm @@ -159,8 +159,8 @@ sub on_pong if (($pongcount % 3) == 0) { #easiest way to do something roughly every 90 seconds $conn->sl('STATS p'); } - if ( @::syncqueue ) { - return; #we don't worry about lag if we've just started up and are still syncing etc. + if ( @::syncqueue || $::netsplit_ignore_lag ) { + return; #we don't worry about lag if we've just started up and are still syncing, or just experienced a netsplit } if (($lag > 2) && ($lag < 5)) { $conn->privmsg( $::settings->{masterchan}, "Warning: I'm currently lagging by $lag seconds."); @@ -411,7 +411,9 @@ sub on_quit if (($::netsplit == 0) && ($event->{args}->[0] eq "*.net *.split") && (lc $event->{nick} ne 'chanserv')) { #special, netsplit situation $conn->privmsg($::settings->{masterchan}, "Entering netsplit mode - JOIN and QUIT inspection will be disabled for 60 minutes"); $::netsplit = 1; + $::netsplit_ignore_lag++; $conn->schedule(60*60, sub { $::netsplit = 0; $conn->privmsg($::settings->{masterchan}, 'Returning to regular operation'); }); + $conn->schedule(2*60, sub { $::netsplit_ignore_lag--; }); } $::inspector->inspect( $conn, $event ) unless $::netsplit; #ugh. Repurge some shit, hopefully this will fix some stuff where things are going wrong diff --git a/meta.pl b/meta.pl index 2e651d6..7ea526b 100755 --- a/meta.pl +++ b/meta.pl @@ -33,6 +33,7 @@ $::pass = ''; @::nick_blacklist=(); @::string_blacklist=(); $::netsplit = 0; +$::netsplit_ignore_lag = 0; $::debug = 0; $::cset = ''; $::pacealerts = 1; -- cgit v1.2.3