diff --git a/cloud/aws/cloudwatchlogs/mode/getlogs.pm b/cloud/aws/cloudwatchlogs/mode/getlogs.pm index 95eef9434..766a31444 100644 --- a/cloud/aws/cloudwatchlogs/mode/getlogs.pm +++ b/cloud/aws/cloudwatchlogs/mode/getlogs.pm @@ -109,6 +109,7 @@ sub check_options { sub manage_selection { my ($self, %options) = @_; + my $current_time = time(); if (!defined($self->{start_time})) { $self->{statefile_cache}->read( statefile => @@ -117,7 +118,6 @@ sub manage_selection { (defined($self->{stream_names}) ? md5_hex(join('-', @{$self->{stream_names}})) : md5_hex('all')) ); $self->{start_time} = $self->{statefile_cache}->get(name => 'last_time'); - my $current_time = time(); $self->{statefile_cache}->write(data => { last_time => $current_time }); if (!defined($self->{start_time})) {