Skip to content

Commit

Permalink
fix: replace lte,gte,addSecond deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
JHIH-LEI committed Aug 23, 2023
1 parent b3fba0d commit 8159b10
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Listeners/MonitorWaitTimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ protected function dueToMonitor()
*/
protected function timeToMonitor()
{
return Chronos::now()->subMinutes(1)->lte($this->lastMonitored);
return Chronos::now()->subMinutes(1)->lessthanOrEquals($this->lastMonitored);
}
}
2 changes: 1 addition & 1 deletion src/Listeners/TrimFailedJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function handle(MasterSupervisorLooped $event)
$this->lastTrimmed = Chronos::now()->subMinutes($this->frequency + 1);
}

if ($this->lastTrimmed->lte(Chronos::now()->subMinutes($this->frequency))) {
if ($this->lastTrimmed->lessthanOrEquals(Chronos::now()->subMinutes($this->frequency))) {
app(JobRepository::class)->trimFailedJobs();

$this->lastTrimmed = Chronos::now();
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/TrimMonitoredJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function handle(MasterSupervisorLooped $event)
$this->lastTrimmed = Chronos::now()->subMinutes($this->frequency + 1);
}

if ($this->lastTrimmed->lte(Chronos::now()->subMinutes($this->frequency))) {
if ($this->lastTrimmed->lessthanOrEquals(Chronos::now()->subMinutes($this->frequency))) {
app(JobRepository::class)->trimMonitoredJobs();

$this->lastTrimmed = Chronos::now();
Expand Down
2 changes: 1 addition & 1 deletion src/Listeners/TrimRecentJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle(MasterSupervisorLooped $event)
$this->lastTrimmed = Chronos::now()->subMinutes($this->frequency + 1);
}

if ($this->lastTrimmed->lte(Chronos::now()->subMinutes($this->frequency))) {
if ($this->lastTrimmed->lessthanOrEquals(Chronos::now()->subMinutes($this->frequency))) {
app(JobRepository::class)->trimRecentJobs();

$this->lastTrimmed = Chronos::now();
Expand Down
2 changes: 1 addition & 1 deletion src/MasterSupervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function terminate($status = 0)
// process does not get stuck in an infinite loop here waiting for these.
while (count($this->supervisors->filter->isRunning())) {
if (Chronos::now()->subSeconds($longest)
->gte($startedTerminating)) {
->greaterThanOrEquals($startedTerminating)) {
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ProcessPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ protected function stopTerminatingProcessesThatAreHanging()
foreach ($this->terminatingProcesses as $process) {
$timeout = $this->options->timeout;

if ($process['terminatedAt']->addSeconds($timeout)->lte(Chronos::now())) {
if ($process['terminatedAt']->addSeconds($timeout)->lessthanOrEquals(Chronos::now())) {
$process['process']->stop();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Supervisor.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected function autoScale()
$this->lastAutoScaled = $this->lastAutoScaled ?:
Chronos::now()->subSeconds($this->autoScaleCooldown + 1);

if (Chronos::now()->subSeconds($this->autoScaleCooldown)->gte($this->lastAutoScaled)) {
if (Chronos::now()->subSeconds($this->autoScaleCooldown)->greaterThanOrEquals($this->lastAutoScaled)) {
$this->lastAutoScaled = Chronos::now();

app(AutoScaler::class)->scale($this);
Expand Down
2 changes: 1 addition & 1 deletion src/WorkerProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected function cooldown()
event(new UnableToLaunchProcess($this));
}
} else {
$this->restartAgainAt = Chronos::now()->addSecond();
$this->restartAgainAt = Chronos::now()->addSeconds(1);
}
}

Expand Down

0 comments on commit 8159b10

Please sign in to comment.