From 41646fbe70b05d4a96addcbdc71c2cc3b7bd8aa2 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 20 Jul 2008 15:50:17 +0200 Subject: [PATCH] Fixed a bug that didn't save scans with nothing in them --- scripts/scans.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ($@) { -- 2.39.2