mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Let MySQL do the time logic when looking for tasks
This commit is contained in:
@@ -47,19 +47,4 @@ class ScheduleRepository extends EloquentRepository implements ScheduleRepositor
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all of the schedules that should be processed.
|
||||
*
|
||||
* @param string $timestamp
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getSchedulesToProcess(string $timestamp): Collection
|
||||
{
|
||||
return $this->getBuilder()->with('tasks')
|
||||
->where('is_active', true)
|
||||
->where('is_processing', false)
|
||||
->where('next_run_at', '<=', $timestamp)
|
||||
->get($this->getColumns());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user