Skip to content

Commit f7f972b

Browse files
committed
rename now variable & fix condition
1 parent 2cd64c0 commit f7f972b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/Jobs/Schedule/RunTaskJob.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ class RunTaskJob extends Job implements ShouldQueue
3030
/**
3131
* @var bool
3232
*/
33-
public $now;
33+
public $manualRun;
3434

3535
/**
3636
* RunTaskJob constructor.
3737
*/
38-
public function __construct(Task $task, $now = false)
38+
public function __construct(Task $task, $manualRun = false)
3939
{
4040
$this->queue = config('pterodactyl.queues.standard');
4141
$this->task = $task;
42-
$this->now = $now;
42+
$this->manualRun = $manualRun;
4343
}
4444

4545
/**
@@ -52,8 +52,8 @@ public function handle(
5252
InitiateBackupService $backupService,
5353
DaemonPowerRepository $powerRepository
5454
) {
55-
// Do not process a task that is not set to active, unless it's been trigger by the run now API.
56-
if ($this->task->schedule->is_active && !$this->now) {
55+
// Do not process a task that is not set to active, unless it's been manually triggered.
56+
if (!$this->task->schedule->is_active && !$this->manualRun) {
5757
$this->markTaskNotQueued();
5858
$this->markScheduleComplete();
5959

@@ -107,7 +107,7 @@ private function queueNextTask()
107107

108108
$nextTask->update(['is_queued' => true]);
109109

110-
$this->dispatch((new self($nextTask, $this->now))->delay($nextTask->time_offset));
110+
$this->dispatch((new self($nextTask, $this->manualRun))->delay($nextTask->time_offset));
111111
}
112112

113113
/**

0 commit comments

Comments
 (0)