From 1828ea2d6ffc25d3a398b7fefd4db5e0a27fe8bf Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 1 Mar 2019 10:26:55 -0500 Subject: [PATCH] small cleanup of zmstats --- scripts/zmstats.pl.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/zmstats.pl.in b/scripts/zmstats.pl.in index 410459158..ba6d8302a 100644 --- a/scripts/zmstats.pl.in +++ b/scripts/zmstats.pl.in @@ -18,9 +18,7 @@ use constant START_DELAY => 30; # To give everything else time to start @EXTRA_PERL_LIB@ use ZoneMinder; -use POSIX; use DBI; -use autouse 'Data::Dumper'=>qw(Dumper); $| = 1; @@ -31,15 +29,15 @@ delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; logInit(); logSetSignal(); -Info("Stats Daemon starting in ".START_DELAY." seconds"); +Info('Stats Daemon starting in '.START_DELAY.' seconds'); sleep(START_DELAY); my $dbh = zmDbConnect(); while( 1 ) { while ( ! ( $dbh and $dbh->ping() ) ) { - Info("Reconnecting to db"); - if ( ! ( $dbh = zmDbConnect() ) ) { + Info('Reconnecting to db'); + if ( !($dbh = zmDbConnect()) ) { #What we do here is not that important, so just skip this interval sleep($Config{ZM_STATS_UPDATE_INTERVAL}); } @@ -53,7 +51,7 @@ while( 1 ) { sleep($Config{ZM_STATS_UPDATE_INTERVAL}); } # end while (1) -Info("Stats Daemon exiting"); +Info('Stats Daemon exiting'); exit(); 1; __END__