X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=6d02704a294e29bdaa06f20eb3786a847deaddf5;hb=ee8c0983439647a8e652e4a344d3958e01219f92;hp=65942b76951038003058f3f7f8e9bb892259b374;hpb=07a56574757b4eca5c4711f819359daab81d2f11;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index 65942b7..6d02704 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -27,7 +27,9 @@ use DBD::Pg qw(:pg_types); use LWP::Simple; -use lib qw{/var/www/ndawn/}; +use FindBin; +use lib "$FindBin::Bin/../lib"; + use ND::DB; our $dbh = ND::DB::DB(); @@ -50,11 +52,14 @@ for my $type ("planet","alliance","galaxy"){ $select->finish; } -if ($updated > 36){ - `/var/www/ndawn/scripts/parsedumps.pl $updated`; - `/var/www/ndawn/scripts/ndrank.pl`; +if ($updated){ + `perl $FindBin::Bin/parsealliances.pl $updated`; + `perl $FindBin::Bin/parseplanets.pl $updated`; + `perl $FindBin::Bin/parsegalaxies.pl $updated`; + `perl $FindBin::Bin/ndrank.pl`; $dbh->do(q{UPDATE misc SET value = ? WHERE id = 'TICK'}, undef, $updated); - $dbh->do(q{VACUUM ANALYZE}); + system 'killall','-USR1', 'ndbot.pl'; + local $dbh->{Warn} = 0; }