]> granicus.if.org Git - pgbadger/commitdiff
Fix increment of session when --disable-session is activated.
authorDarold Gilles <gilles@darold.net>
Mon, 28 Apr 2014 20:20:38 +0000 (22:20 +0200)
committerDarold Gilles <gilles@darold.net>
Mon, 28 Apr 2014 20:20:38 +0000 (22:20 +0200)
pgbadger

index bd053c234e279c723656e36f201d224ae2eb475d..2da3501ac9f5215ab361c5ebf2a413b8bc8beb92 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -8309,8 +8309,10 @@ sub parse_query
        if (   ($prefix_vars{'t_loglevel'} eq 'LOG')
                && ($prefix_vars{'t_query'} =~ /connection authorized: user=([^\s]+) /))
        {
+               $current_sessions{$prefix_vars{'t_pid'}} = 1 if (!$disable_session);
+
                return if ($disable_connection);
-               $current_sessions{$prefix_vars{'t_pid'}} = 1;
+
                my $usr = $1;
                my $db  = 'unknown';
                my $host  = '';
@@ -8365,10 +8367,11 @@ sub parse_query
                        /disconnection: session time: ([^\s]+) user=([^\s]+) database=([^\s]+) host=([^\s]+)/))
        {
                return if ($disable_session);
+
+               delete $current_sessions{$prefix_vars{'t_pid'}};
                if ($extension eq 'tsung') {
                        $tsung_session{$prefix_vars{'t_pid'}}{disconnection}{date} = $prefix_vars{'t_timestamp'};
                }
-               delete $current_sessions{$prefix_vars{'t_pid'}};
                my $time = $1;
                my $usr  = $2;
                my $db   = $3;