]> git.sesse.net Git - remoteglot/commitdiff
Allow polling more often.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 27 Dec 2023 10:29:41 +0000 (11:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 7 Feb 2024 16:47:46 +0000 (17:47 +0100)
config.pm
remoteglot.pl

index 1bd40e57ce7db8d2ad3f23c31c8c28f6f17c11f1..073ab92f6192f2ff10b2961ec1673e83634a0a82 100644 (file)
--- 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;
index 08e03ea876748cf8a7dd9c6b16d9a840f711536b..f7b0456cee7f0cd316315142cca1ab6e9115d5b3 100755 (executable)
@@ -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);
        });
 }