diff options
| author | 2015-11-26 12:34:10 +0400 | |
|---|---|---|
| committer | 2015-11-26 12:34:10 +0400 | |
| commit | 1b274f2ff5d2d62b4de643cf1201da889c4cd730 (patch) | |
| tree | 74677945facab369669293e1865eeb11b5358c9c /lib/ASM/Event.pm | |
| parent | 17498f84521b979d54a5aa72e64c7a65fa6ba5be (diff) | |
Ignore lag for 2 minutes after a netsplit
Diffstat (limited to 'lib/ASM/Event.pm')
| -rw-r--r-- | lib/ASM/Event.pm | 6 |
1 files changed, 4 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 |
