X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=b64200f355318487bef1e9fc69a4ba9469fd7cf4;hb=44d272d9a8cff54ec21b9fb07325a0c63a5b1121;hp=71f4e7e4835d4dd6d1ec20576e33e6a94c555239;hpb=13e3df1e4218c19325ef732a4a2cb2b7db79a69c;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index 71f4e7e..b64200f 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -22,12 +22,15 @@ q{ use strict; use warnings; +use local::lib; use DBI; use DBD::Pg qw(:pg_types); use LWP::Simple; -use lib qw{/var/www/ndawn/lib/}; +use FindBin; +use lib "$FindBin::Bin/../lib"; + use ND::DB; our $dbh = ND::DB::DB(); @@ -51,12 +54,13 @@ for my $type ("planet","alliance","galaxy"){ } if ($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`; + `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; }