From 16ac6d95fb5f48ec3f7e018356c45ed14d395663 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 6 Mar 2020 13:28:06 -0800 Subject: [PATCH] Give sensible names to various existing timers --- PBot/AntiFlood.pm | 2 +- PBot/ChanOps.pm | 4 ++-- PBot/IRCHandlers.pm | 2 +- PBot/LagChecker.pm | 4 ++-- PBot/PBot.pm | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 0b0b09e9..daa0989e 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -41,7 +41,7 @@ sub initialize { $self->{'ban-exemptions'} = PBot::DualIndexHashObject->new(name => 'Ban exemptions', filename => $filename, pbot => $self->{pbot}); $self->{'ban-exemptions'}->load; - $self->{pbot}->{timer}->register(sub { $self->adjust_offenses }, 60 * 60 * 1); + $self->{pbot}->{timer}->register(sub { $self->adjust_offenses }, 60 * 60 * 1, 'AntiFlood Adjust Offenses'); $self->{pbot}->{registry}->add_default('text', 'antiflood', 'enforce', $conf{enforce_antiflood} // 1); diff --git a/PBot/ChanOps.pm b/PBot/ChanOps.pm index 543cadf7..a9e32dd6 100644 --- a/PBot/ChanOps.pm +++ b/PBot/ChanOps.pm @@ -48,10 +48,10 @@ sub initialize { $self->{pbot}->{registry}->add_default('text', 'general', 'deop_timeout', 300); - $self->{pbot}->{timer}->register(sub { $self->check_opped_timeouts }, 10); $self->{pbot}->{timer}->register(sub { $self->check_unban_timeouts }, 10); $self->{pbot}->{timer}->register(sub { $self->check_unmute_timeouts }, 10); - $self->{pbot}->{timer}->register(sub { $self->check_unban_queue }, 30); + $self->{pbot}->{timer}->register(sub { $self->check_opped_timeouts }, 10, 'Check Opped Timeouts'); + $self->{pbot}->{timer}->register(sub { $self->check_unban_queue }, 30, 'Check Unban Queue'); } sub can_gain_ops { diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index 8a889332..002ace3d 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -49,7 +49,7 @@ sub initialize { $self->{pbot}->{event_dispatcher}->register_handler('pbot.join', sub { $self->on_self_join(@_) }); $self->{pbot}->{event_dispatcher}->register_handler('pbot.part', sub { $self->on_self_part(@_) }); - $self->{pbot}->{timer}->register(sub { $self->check_pending_whos }, 10); + $self->{pbot}->{timer}->register(sub { $self->check_pending_whos }, 10, 'Check Pending Whos'); } sub default_handler { diff --git a/PBot/LagChecker.pm b/PBot/LagChecker.pm index 26afae83..ec8afe4d 100644 --- a/PBot/LagChecker.pm +++ b/PBot/LagChecker.pm @@ -40,7 +40,7 @@ sub initialize { $self->{pbot}->{timer}->register( sub { $self->send_ping }, $self->{pbot}->{registry}->get_value('lagchecker', 'lag_history_interval'), - 'lag_history_interval' + 'lag check' ); $self->{pbot}->{commands}->register(sub { $self->lagcheck(@_) }, "lagcheck", 0); @@ -49,7 +49,7 @@ sub initialize { sub lag_history_interval_trigger { my ($self, $section, $item, $newvalue) = @_; - $self->{pbot}->{timer}->update_interval('lag_history_interval', $newvalue); + $self->{pbot}->{timer}->update_interval('lag check', $newvalue); } sub send_ping { diff --git a/PBot/PBot.pm b/PBot/PBot.pm index 8da98275..5c12b2ab 100644 --- a/PBot/PBot.pm +++ b/PBot/PBot.pm @@ -148,7 +148,7 @@ sub initialize { $self->{logger}->log("module_dir: $module_dir\n"); $self->{logger}->log("plugin_dir: $plugin_dir\n"); - $self->{timer} = PBot::Timer->new(pbot => $self, timeout => 10, %conf); + $self->{timer} = PBot::Timer->new(pbot => $self, timeout => 10, name => 'PBot Timer', %conf); $self->{modules} = PBot::Modules->new(pbot => $self, %conf); $self->{functions} = PBot::Functions->new(pbot => $self, %conf); $self->{refresher} = PBot::Refresher->new(pbot => $self);