rename now variable & fix condition
This commit is contained in:
parent
2cd64c0af4
commit
f7f972b33d
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue