From: Steinar H. Gunderson Date: Wed, 27 Dec 2023 10:29:41 +0000 (+0100) Subject: Allow polling more often. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=04d3e4d93513d9a060b82eff5e45d68294afa932 Allow polling more often. --- diff --git a/config.pm b/config.pm index 1bd40e5..073ab92 100644 --- a/config.pm +++ b/config.pm @@ -77,6 +77,9 @@ our $dbipass = undef; # For manual moves made from the web interface. our $adminpass = undef; +# How often to poll the target, in seconds. +our $poll_frequency = 1.0; + eval { my $config_filename = $ENV{'REMOTEGLOT_CONFIG'} // 'config.local.pm'; require $config_filename; diff --git a/remoteglot.pl b/remoteglot.pl index 08e03ea..f7b0456 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -142,7 +142,7 @@ sub fetch_pgn { }; if ($@) { warn "$url: $@"; - $http_timer = AnyEvent->timer(after => 1.0, cb => sub { + $http_timer = AnyEvent->timer(after => $remoteglotconf::poll_frequency, cb => sub { fetch_pgn($url); }); } @@ -252,7 +252,7 @@ sub handle_pgn { } } - $http_timer = AnyEvent->timer(after => 1.0, cb => sub { + $http_timer = AnyEvent->timer(after => $remoteglotconf::poll_frequency, cb => sub { fetch_pgn($url); }); }