From 779e0a618d280c815ca0b07e7e099bd3116d02aa Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 19 Oct 2018 14:49:03 +0100 Subject: [PATCH] #441 change localtime to gmtime --- bin/netdisco-do | 6 +++--- lib/App/Netdisco/Backend/Role/Poller.pm | 4 ++-- lib/App/Netdisco/Util/Graph.pm | 2 +- lib/App/Netdisco/Util/Statistics.pm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/netdisco-do b/bin/netdisco-do index 9faf8c12..6df98f34 100755 --- a/bin/netdisco-do +++ b/bin/netdisco-do @@ -137,7 +137,7 @@ foreach my $host (@hostlist) { if ($queue_only) { jq_insert( \@job_specs ); info sprintf '%s: queued %s jobs at %s', - $action, (scalar @job_specs), scalar localtime; + $action, (scalar @job_specs), scalar gmtime; } else { foreach my $spec (@job_specs) { @@ -152,7 +152,7 @@ else { # do job try { info sprintf '%s: %s started at %s', - $action, $actiontext, scalar localtime; + $action, $actiontext, scalar gmtime; $worker->run($job); } catch { @@ -168,7 +168,7 @@ else { ); } - info sprintf '%s: finished at %s', $action, scalar localtime; + info sprintf '%s: finished at %s', $action, scalar gmtime; info sprintf '%s: status %s: %s', $action, $job->status, $job->log; $exitstatus = 1 if !$exitstatus and $job->status ne 'done'; } diff --git a/lib/App/Netdisco/Backend/Role/Poller.pm b/lib/App/Netdisco/Backend/Role/Poller.pm index 27f49cc5..45a063ba 100644 --- a/lib/App/Netdisco/Backend/Role/Poller.pm +++ b/lib/App/Netdisco/Backend/Role/Poller.pm @@ -27,7 +27,7 @@ sub worker_body { next unless defined $job; try { - $job->started(scalar localtime); + $job->started(scalar gmtime); prctl sprintf 'nd2: #%s poll: #%s: %s', $wid, $job->id, $job->display_name; info sprintf "pol (%s): starting %s job(%s) at %s", @@ -48,7 +48,7 @@ sub worker_body { sub close_job { my ($self, $job) = @_; - my $now = scalar localtime; + my $now = scalar gmtime; info sprintf "pol (%s): wrapping up %s job(%s) - status %s at %s", $self->wid, $job->action, $job->id, $job->status, $now; diff --git a/lib/App/Netdisco/Util/Graph.pm b/lib/App/Netdisco/Util/Graph.pm index f8e8124a..5aa01a2e 100644 --- a/lib/App/Netdisco/Util/Graph.pm +++ b/lib/App/Netdisco/Util/Graph.pm @@ -62,7 +62,7 @@ Creates netmap of network. sub graph { my %CONFIG = %{ setting('graph') }; - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(); my $month = sprintf("%d%02d",$year+1900,$mon+1); info "graph() - Creating Graphs"; diff --git a/lib/App/Netdisco/Util/Statistics.pm b/lib/App/Netdisco/Util/Statistics.pm index 2e4e4d9f..c1330a49 100644 --- a/lib/App/Netdisco/Util/Statistics.pm +++ b/lib/App/Netdisco/Util/Statistics.pm @@ -3,7 +3,7 @@ package App::Netdisco::Util::Statistics; use Dancer qw/:syntax :script/; use Dancer::Plugin::DBIC 'schema'; -use Time::Piece; # for OO localtime +use Time::Piece; # for OO gmtime use base 'Exporter'; our @EXPORT = (); @@ -40,7 +40,7 @@ sub update_stats { $schema->txn_do(sub { $schema->resultset('Statistics')->update_or_create({ - day => localtime->ymd, + day => gmtime->ymd, device_count => $schema->resultset('Device')->count_rs->as_query,