]> git.sesse.net Git - wloh/blobdiff - train.pl
Increase the expiry time for the ratings page, and rely on clearing it explicitly...
[wloh] / train.pl
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 = ();