From 04d3e4d93513d9a060b82eff5e45d68294afa932 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 27 Dec 2023 11:29:41 +0100 Subject: [PATCH] Allow polling more often. --- config.pm | 3 +++ remoteglot.pl | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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); }); } -- 2.39.2