diff --git a/app/Jobs/Schedule/RunTaskJob.php b/app/Jobs/Schedule/RunTaskJob.php index 0cffe4e85..fa62bc004 100644 --- a/app/Jobs/Schedule/RunTaskJob.php +++ b/app/Jobs/Schedule/RunTaskJob.php @@ -104,7 +104,8 @@ class RunTaskJob extends Job implements ShouldQueue { /** @var \Pterodactyl\Models\Task|null $nextTask */ $nextTask = Task::query()->where('schedule_id', $this->task->schedule_id) - ->where('sequence_id', $this->task->sequence_id + 1) + ->orderBy('sequence_id', 'asc') + ->where('sequence_id', '>', $this->task->sequence_id) ->first(); if (is_null($nextTask)) { diff --git a/app/Repositories/Eloquent/TaskRepository.php b/app/Repositories/Eloquent/TaskRepository.php index 718f99490..a375939ad 100644 --- a/app/Repositories/Eloquent/TaskRepository.php +++ b/app/Repositories/Eloquent/TaskRepository.php @@ -41,7 +41,8 @@ class TaskRepository extends EloquentRepository implements TaskRepositoryInterfa public function getNextTask(int $schedule, int $index) { return $this->getBuilder()->where('schedule_id', '=', $schedule) - ->where('sequence_id', '=', $index + 1) + ->orderBy('sequence_id', 'asc') + ->where('sequence_id', '>', $index) ->first($this->getColumns()); } } diff --git a/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx b/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx index fdd602304..88c85c5a8 100644 --- a/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx +++ b/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx @@ -139,7 +139,7 @@ export default () => {