From: brunomgalmeida Date: Thu, 1 May 2014 14:49:06 +0000 (+0100) Subject: revert to single thread if file is small X-Git-Tag: v5.1~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2594cbc7dc106f13d409fc1db96dc05a58b6c36;p=pgbadger revert to single thread if file is small print calendars 4+4+4 instead of 3+4+4+1 when looking at a full year --- diff --git a/pgbadger b/pgbadger index 1e96f16..e92afc1 100644 --- a/pgbadger +++ b/pgbadger @@ -1225,8 +1225,8 @@ if (!$incremental) { closedir DIR; my $i = 1; foreach my $m (sort {$a <=> $b } @ymonths) { - print $fh "\n\n" if ( ($i%4) == 0 ); print $fh "", &get_calendar($y, $m), "\n"; + print $fh "\n\n" if ( ($i%4) == 0 ); $i++; } print $fh qq{ @@ -10227,7 +10227,11 @@ sub split_logfile # Real size of the file is unknown, try to find it # bz2 does not report real size - if ($logf =~ /\.(gz|zip)/i) { + if ($totalsize <= 16777216) { #16MB + #If the file is very small, many jobs actually make the parsing take longer + #What is an acceptable file size???? + $queue_size = 0; + } elsif ($logf =~ /\.(gz|zip)/i) { $totalsize = 0; my $cmd_file_size = $gzip_uncompress_size; if ($logf =~ /\.zip/i) {