Skip to content

Commit

Permalink
Fix instant discovery to not zero pad times.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Mar 4, 2024
1 parent 1128bba commit cf0f722
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Controllers/Discoveries.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit cf0f722

Please sign in to comment.