]> granicus.if.org Git - pgbadger/commitdiff
Fix writing of empty incremental last parsed file.
authorDarold Gilles <gilles@darold.net>
Mon, 10 Mar 2014 16:39:41 +0000 (17:39 +0100)
committerDarold Gilles <gilles@darold.net>
Mon, 10 Mar 2014 16:39:41 +0000 (17:39 +0100)
pgbadger

index 046a64efb9985acb9f1151dd6392ec49b227ae05..cbd05d7dd68bc887beae52b1b2adac751f186275 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -911,7 +911,7 @@ if ($last_parsed) {
 }
 
 # Save last line parsed
-if ($last_parsed && scalar keys %last_line) {
+if ($last_parsed && $last_line{datetime} && $last_line{orig}) {
        if (open(OUT, ">$last_parsed")) {
                $last_line{current_pos} ||= 0;
                print OUT "$last_line{datetime}\t$last_line{current_pos}\t$last_line{orig}\n";