diff --git a/src/Handler.php b/src/Handler.php index ef91f083d6ca729dbfc29ab2148a478cc2091be4..c55e36a28dd2d740bba3d482b54077c4891d41f6 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -551,6 +551,7 @@ class Handler extends BaseHandler { foreach ($tasks as $name => $task) { $disabled = !empty($task['disabled']); $command = $task['command']; + $schedule = $task['schedule']; $ping_url = FALSE; $task['name'] = $name; if (isset($hj_manager)) { @@ -558,6 +559,10 @@ class Handler extends BaseHandler { $task['channels'] = $hj_api_channels; $task['tags'] = implode(' ', ['d4d', $hj_project, $hj_branch]); $task['tz'] = $hj_timezone; + if (count(explode(' ', $task['schedule'])) === 6) { + // Schedule contains seconds, they need to be removed. + $task['schedule'] = substr($task['schedule'], strpos($task['schedule'], ' ') + 1); + } $check = NULL; foreach ($hj_checks as $existing) { @@ -606,13 +611,13 @@ class Handler extends BaseHandler { } } if (!$disabled) { - if (count(explode(' ', $task['schedule'])) === 5) { + if (count(explode(' ', $schedule)) === 5) { // Add leading "0" for seconds. - $task['schedule'] = '0 ' . $task['schedule']; + $schedule = '0 ' . $schedule; } $activeTasks[] = [ 'name' => $task['name'], - 'schedule' => $task['schedule'], + 'schedule' => $schedule, 'command' => $command, 'ping_url' => $ping_url, 'user' => $user,