X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=44a8d411eb7f00270ccb5c86545a78e70b61a67e;hb=fe92f95649f91029d18ec050252382332fe0fb96;hp=b8be1c36ca111561d5054337d18ecba75fc84b9b;hpb=f2c438684b7835e8c2033999fcc020d9352afca8;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index b8be1c3..44a8d41 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,13 @@ for my $type ("planet","alliance","galaxy"){ $select->finish; } -if ($updated){ - `/var/www/ndawn/scripts/parsedumps.pl $updated`; +if ($updated > 36){ + `/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}); }