]> git.sesse.net Git - wloh/commitdiff
Increase the expiry time for the ratings page, and rely on clearing it explicitly...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 13 Jun 2012 13:45:29 +0000 (15:45 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 13 Jun 2012 13:45:29 +0000 (15:45 +0200)
include/common.pm
train.pl
www/rating.pl

index 9348b15da9a10bb67736234c8ad465d575c5733c..207bfe9297d836b2e7a8fa979ad1bf1725dfbe6e 100644 (file)
@@ -161,4 +161,17 @@ sub get_ordinal {
        }       
 }
 
+sub find_all_locales {
+       my $dbh = shift;
+       my $q = $dbh->prepare('SELECT kultur FROM fotballspraak WHERE nyestesesong<>-1');
+       $q->execute;
+
+       my @locales = ();
+       while (my $ref = $q->fetchrow_hashref) {
+               push @locales, $ref->{'kultur'};
+       }
+
+       return @locales;
+}
+
 1;
index e3b106b15fea1758dd109c071d2e0cdd596291b9..84335e15ee6b459486f51dcf170351ab3a363319 100755 (executable)
--- a/train.pl
+++ b/train.pl
@@ -6,6 +6,7 @@ no warnings qw(once);
 use POSIX;
 use lib qw( include );
 require 'config.pm';
+require 'common.pm';
 
 # Find last completely done season 
 sub find_last_season {
@@ -79,19 +80,6 @@ sub train_model {
        close RATINGS;
 }
 
-sub find_all_locales {
-       my $dbh = shift;
-       my $q = $dbh->prepare('SELECT kultur FROM fotballspraak WHERE nyestesesong<>-1');
-       $q->execute;
-
-       my @locales = ();
-       while (my $ref = $q->fetchrow_hashref) {
-               push @locales, $ref->{'kultur'};
-       }
-
-       return @locales;
-}
-
 my $dbh = DBI->connect($config::local_connstr, $config::local_username, $config::local_password)
        or die "connect: " . $DBI::errstr;
 $dbh->{AutoCommit} = 0;
@@ -99,7 +87,7 @@ $dbh->{RaiseError} = 1;
 
 $dbh->do('SET client_min_messages TO WARNING');
 
-my @locales = find_all_locales($dbh);
+my @locales = wloh_common::find_all_locales($dbh);
 
 my @ratings = ();
 my @covariances = ();
index fa1eb9d9fda943eacaa1f91521fa7f5908b2bca8..557231538514e8743bf8463418e1d10aea5b7a15 100755 (executable)
@@ -97,7 +97,7 @@ while (my $ref = $q->fetchrow_hashref) {
        push @players, \%player;
 }
 
-print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+5m');
+print CGI->header(-type=>'text/html; charset=utf-8', -expires=>'+75m');
 wloh_common::process_template('rating', $locale, {
        '#navbar' => wloh_common::get_navbar($cgi, $dbh, $locale),
        'iterations' => $aux_parms->{'num_iterations'},