Don't run schedules when a server is suspended or installing; closes #4008
This commit is contained in:
parent
ab37ee8633
commit
b07fdc100c
3 changed files with 46 additions and 1 deletions
|
@ -7,6 +7,7 @@ use Throwable;
|
|||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Models\Schedule;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Pterodactyl\Services\Schedules\ProcessScheduleService;
|
||||
|
||||
class ProcessRunnableCommand extends Command
|
||||
|
@ -26,7 +27,9 @@ class ProcessRunnableCommand extends Command
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
$schedules = Schedule::query()->with('tasks')
|
||||
$schedules = Schedule::query()
|
||||
->with('tasks')
|
||||
->whereRelation('server', fn (Builder $builder) => $builder->whereNull('status'))
|
||||
->where('is_active', true)
|
||||
->where('is_processing', false)
|
||||
->whereRaw('next_run_at <= NOW()')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue