From cf0f722a82cf0fa511496d55896c06a7d70a1f68 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Mon, 4 Mar 2024 10:04:33 +1000 Subject: [PATCH] Fix instant discovery to not zero pad times. --- app/Controllers/Discoveries.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Controllers/Discoveries.php b/app/Controllers/Discoveries.php index b53742668..58cccc189 100644 --- a/app/Controllers/Discoveries.php +++ b/app/Controllers/Discoveries.php @@ -112,10 +112,10 @@ public function executeCollector($id) $now = time(); $next = intval(round(ceil(($now + 60) / 300) * 300)); - $minute = date('i', $next); - $hour = date('H', $next); - $day_of_month = date('d', $next); - $month = date('m', $next); + $minute = intval(date('i', $next)); + $hour = intval(date('H', $next)); + $day_of_month = intval(date('d', $next)); + $month = intval(date('m', $next)); $sql = "INSERT INTO tasks (`name`, `org_id`, `description`, `sub_resource_id`, `uuid`, `enabled`, `type`, `minute`, `hour`, `day_of_month`, `month`, `day_of_week`, `first_run`, `edited_by`, `edited_date`) VALUES (?, ?, ?, ?, ?, 'y', 'discoveries', ?, ?, ?, ?, '*', '2000-01-01 12:00:00', ?, NOW())"; $attributes = [