only get enabled scheduled tasks

This commit is contained in:
Andras Bacsai
2024-11-06 12:46:28 +01:00
parent bd64505451
commit 4b3bf832f5

View File

@@ -179,14 +179,11 @@ class Kernel extends ConsoleKernel
private function checkScheduledTasks($schedule): void
{
$scheduled_tasks = ScheduledTask::all();
$scheduled_tasks = ScheduledTask::where('enabled', true)->get();
if ($scheduled_tasks->isEmpty()) {
return;
}
foreach ($scheduled_tasks as $scheduled_task) {
if ($scheduled_task->enabled === false) {
continue;
}
$service = $scheduled_task->service;
$application = $scheduled_task->application;