From 07a56574757b4eca5c4711f819359daab81d2f11 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 26 Mar 2008 12:31:38 +0100 Subject: [PATCH] Minor fixes --- scripts/fetchdumps.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index b8be1c3..65942b7 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -42,7 +42,7 @@ for my $type ("planet","alliance","galaxy"){ $select->execute($type,$head[2]); unless ($select->fetchrow){ my $file = get("http://game.planetarion.com/botfiles/${type}_listing.txt"); - if ($file =~ /Tick: (\d+)/){ + if (defined $file && $file =~ /Tick: (\d+)/){ $updated = $1; $insert->execute($1,$type,$head[2],$file); } @@ -50,10 +50,11 @@ for my $type ("planet","alliance","galaxy"){ $select->finish; } -if ($updated){ +if ($updated > 36){ `/var/www/ndawn/scripts/parsedumps.pl $updated`; `/var/www/ndawn/scripts/ndrank.pl`; - $dbh->do("UPDATE misc SET value = ? WHERE id = 'TICK'", undef, $updated); + $dbh->do(q{UPDATE misc SET value = ? WHERE id = 'TICK'}, undef, $updated); + $dbh->do(q{VACUUM ANALYZE}); } -- 2.39.2