X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=71f4e7e4835d4dd6d1ec20576e33e6a94c555239;hb=5d49b3579d2ad39f6ae9bc2dba37ebbf0334e0da;hp=b8be1c36ca111561d5054337d18ecba75fc84b9b;hpb=9154d589bf4a0dc3310ee79752c71674f69c85a7;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index b8be1c3..71f4e7e 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -27,7 +27,7 @@ use DBD::Pg qw(:pg_types); use LWP::Simple; -use lib qw{/var/www/ndawn/}; +use lib qw{/var/www/ndawn/lib/}; use ND::DB; our $dbh = ND::DB::DB(); @@ -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); } @@ -51,9 +51,12 @@ for my $type ("planet","alliance","galaxy"){ } if ($updated){ - `/var/www/ndawn/scripts/parsedumps.pl $updated`; + `/var/www/ndawn/scripts/parsealliances.pl $updated`; + `/var/www/ndawn/scripts/parseplanets.pl $updated`; + `/var/www/ndawn/scripts/parsegalaxies.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}); }