3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-10-14 06:57:25 +02:00

LagChecker: send another ping if no pong received after 15 minutes

This commit is contained in:
Pragmatic Software 2025-10-11 09:39:12 -07:00
parent e035745860
commit a3c0f616fb
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 6 additions and 3 deletions

View File

@ -67,7 +67,10 @@ sub trigger_lag_history_interval($self, $section, $item, $newvalue) {
sub send_ping($self) { sub send_ping($self) {
return unless defined $self->{pbot}->{conn} && $self->{pbot}->{conn}->connected && $self->{welcomed}; return unless defined $self->{pbot}->{conn} && $self->{pbot}->{conn}->connected && $self->{welcomed};
return if defined $self->{pong_received} && $self->{pong_received} == 0; if (defined $self->{pong_received} && $self->{pong_received} == 0
&& gettimeofday - $self->{ping_send_time}[0] < 900) {
return;
}
$self->{ping_send_time} = [gettimeofday]; $self->{ping_send_time} = [gettimeofday];
$self->{pong_received} = 0; $self->{pong_received} = 0;

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4904, BUILD_REVISION => 4905,
BUILD_DATE => "2025-10-08", BUILD_DATE => "2025-10-11",
}; };
sub initialize {} sub initialize {}