rename now variable & fix condition

This commit is contained in:
Julien Tant 2021-04-24 18:18:29 -07:00
parent 2cd64c0af4
commit f7f972b33d
1 changed files with 6 additions and 6 deletions

View File

@ -30,16 +30,16 @@ class RunTaskJob extends Job implements ShouldQueue
/** /**
* @var bool * @var bool
*/ */
public $now; public $manualRun;
/** /**
* RunTaskJob constructor. * RunTaskJob constructor.
*/ */
public function __construct(Task $task, $now = false) public function __construct(Task $task, $manualRun = false)
{ {
$this->queue = config('pterodactyl.queues.standard'); $this->queue = config('pterodactyl.queues.standard');
$this->task = $task; $this->task = $task;
$this->now = $now; $this->manualRun = $manualRun;
} }
/** /**
@ -52,8 +52,8 @@ class RunTaskJob extends Job implements ShouldQueue
InitiateBackupService $backupService, InitiateBackupService $backupService,
DaemonPowerRepository $powerRepository DaemonPowerRepository $powerRepository
) { ) {
// Do not process a task that is not set to active, unless it's been trigger by the run now API. // Do not process a task that is not set to active, unless it's been manually triggered.
if ($this->task->schedule->is_active && !$this->now) { if (!$this->task->schedule->is_active && !$this->manualRun) {
$this->markTaskNotQueued(); $this->markTaskNotQueued();
$this->markScheduleComplete(); $this->markScheduleComplete();
@ -107,7 +107,7 @@ class RunTaskJob extends Job implements ShouldQueue
$nextTask->update(['is_queued' => true]); $nextTask->update(['is_queued' => true]);
$this->dispatch((new self($nextTask, $this->now))->delay($nextTask->time_offset)); $this->dispatch((new self($nextTask, $this->manualRun))->delay($nextTask->time_offset));
} }
/** /**