Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Do not use now helper, as Queue package is not aware of Foundation. #20880

Merged
merged 2 commits into from
Aug 31, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Do not use now helper, as Queue package is not aware of Foundation.
  • Loading branch information
lucasmichot committed Aug 31, 2017
commit fb8b538c547342b80d6750d14083ffbc7878354c
5 changes: 3 additions & 2 deletions src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Exception;
use Throwable;
use Illuminate\Support\Carbon;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\DetectsLostConnections;
use Illuminate\Contracts\Debug\ExceptionHandler;
Expand Down Expand Up @@ -382,7 +383,7 @@ protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $

$timeoutAt = $job->timeoutAt();

if ($timeoutAt && now()->getTimestamp() <= $timeoutAt) {
if ($timeoutAt && Carbon::now()->getTimestamp() <= $timeoutAt) {
return;
}

Expand Down Expand Up @@ -410,7 +411,7 @@ protected function markJobAsFailedIfWillExceedMaxAttempts($connectionName, $job,
{
$maxTries = ! is_null($job->maxTries()) ? $job->maxTries() : $maxTries;

if ($job->timeoutAt() && $job->timeoutAt() <= now()->getTimestamp()) {
if ($job->timeoutAt() && $job->timeoutAt() <= Carbon::now()->getTimestamp()) {
$this->failJob($connectionName, $job, $e);
}

Expand Down