From 5de2bb3effd09a422fba33a469fa53236e93c796 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 18 Dec 2018 15:56:30 +0100 Subject: [PATCH] Fixed module_crontab in first execution in Linux Former-commit-id: f4d37d7103f8d2ecfc00fd43360e8a58a31f775a --- pandora_agents/unix/pandora_agent | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a2f7f5530e..5a994ae25c 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2397,6 +2397,7 @@ sub check_module_cron { $interval ); + my $is_first = ($module->{'cron_utimestamp'} == 0) ? 1 : $module->{'cron_utimestamp'} = $now + $time_to_next_execution; $module->{'cron_interval'} = $time_to_next_execution; @@ -2405,7 +2406,7 @@ sub check_module_cron { } # On first execution checking if cron is valid is required - return 1 unless ($module->{'cron_utimestamp'} == 0); + return 1 unless ($is_first); # Check if current timestamp is a valid cron date my $next_execution = cron_next_execution_date(