chore: Skip scheduled tasks if application or service is not running
This commit is contained in:
parent
9dc3ec0bf8
commit
5ad08791ea
@ -138,7 +138,18 @@ private function check_scheduled_tasks($schedule)
|
|||||||
$scheduled_task->delete();
|
$scheduled_task->delete();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($application) {
|
||||||
|
if (str($application->status)->contains('running') === false) {
|
||||||
|
ray('application not running, skipping');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($service) {
|
||||||
|
if (str($service->status)->contains('running') === false) {
|
||||||
|
ray('service not running, skipping');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isset(VALID_CRON_STRINGS[$scheduled_task->frequency])) {
|
if (isset(VALID_CRON_STRINGS[$scheduled_task->frequency])) {
|
||||||
$scheduled_task->frequency = VALID_CRON_STRINGS[$scheduled_task->frequency];
|
$scheduled_task->frequency = VALID_CRON_STRINGS[$scheduled_task->frequency];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user