From: Michael Andreen Date: Sun, 20 Jul 2008 13:50:17 +0000 (+0200) Subject: Fixed a bug that didn't save scans with nothing in them X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=41646fbe70b05d4a96addcbdc71c2cc3b7bd8aa2 Fixed a bug that didn't save scans with nothing in them --- diff --git a/scripts/scans.pl b/scripts/scans.pl index 30bd8be..e9795f7 100755 --- a/scripts/scans.pl +++ b/scripts/scans.pl @@ -81,6 +81,8 @@ $dbh->pg_savepoint('scans') or die "No savepoint"; my %production = (None => 0, Low => 35, Medium => 65, High => 100); while (my $scan = $newscans->fetchrow_hashref){ + $dbh->pg_release('scans') or die "Couldn't save"; + $dbh->pg_savepoint('scans') or die "Couldn't save"; my $file = get("http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}"); next unless defined $file; if ($file =~ /((?:\w| )*) (?:Scan|Probe) on (\d+):(\d+):(\d+) in tick (\d+)/){ @@ -192,8 +194,6 @@ while (my $scan = $newscans->fetchrow_hashref){ print "Something wrong with scan $scan->{id} type $type at tick $tick http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}"; } $parsedscan->execute($tick,$type,$planet,$scan->{id}) or die $dbh->errstr; - $dbh->pg_release('scans') or die "Couldn't save"; - $dbh->pg_savepoint('scans') or die "Couldn't save"; #$dbh->rollback; }; if ($@) {