From: Darold Gilles Date: Thu, 7 Aug 2014 14:39:30 +0000 (+0200) Subject: Fix incomplete completion of progress bar since previous patch. X-Git-Tag: v6.0~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7b76d4f1194313ec9f7f83624525d82a254166b;p=pgbadger Fix incomplete completion of progress bar since previous patch. --- diff --git a/pgbadger b/pgbadger index 43524d8..1d90a16 100755 --- a/pgbadger +++ b/pgbadger @@ -1701,8 +1701,8 @@ sub process_file my $old_queries_count = 0; my $old_errors_count = 0; - my $current_offset = $start_offset || 0; my $getout = 0; + $start_offset ||= 0; $0 = 'pgbadger parser'; @@ -1740,15 +1740,22 @@ sub process_file &logmsg('DEBUG', "Reverting start offset $start_offset to 0 for file $logfile, stoppping offset is " . ($stop_offset || $totalsize)); $start_offset = 0; } - # In non multiprocess mode, the progress bar must start at the offset - $cursize += $start_offset if (!$tmpoutfile); + $cursize = $start_offset; } + } else { + $start_offset = 0; + $stop_offset = 0; } if ($stop_offset > 0) { $totalsize = $stop_offset - $start_offset; } + my $current_offset = $start_offset || 0; + + # Forward the progress bar to the starting point in MP mode + #$cursize = $start_offset if ($chunk_pos == 0); + if (!$remote_host) { &logmsg('DEBUG', "Starting reading file $logfile..."); } else { @@ -1862,7 +1869,6 @@ sub process_file if ($#exclude_line >= 0) { $has_exclusion = 1; } - $start_offset ||= 0; &logmsg('DEBUG', "Start parsing at offset $start_offset of file $logfile to $stop_offset"); if ($start_offset) { # Move to the starting offset position in file @@ -2186,10 +2192,6 @@ sub process_file if ($last_parsed) { $last_line{current_pos} = $current_offset; } - # Forward the progress bar to the ending point in multiprocess mode - if ($progress && $tmpoutfile) { - $pipe->print("$start_offset 0 0\n"); - } } close $lfile;