Skip to content

Commit

Permalink
Merge branch 'fix-retry-command-for-encrypted-jobs' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 21, 2021
2 parents e4927c1 + 2fb5e44 commit 054c391
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Illuminate/Queue/Console/RetryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use DateTimeInterface;
use Illuminate\Console\Command;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use RuntimeException;

class RetryCommand extends Command
{
Expand Down Expand Up @@ -131,7 +134,15 @@ protected function refreshRetryUntil($payload)
return json_encode($payload);
}

$instance = unserialize($payload['data']['command']);
if (Str::startsWith($payload['data']['command'], 'O:')) {
$instance = unserialize($payload['data']['command']);
} elseif ($this->laravel->bound(Encrypter::class)) {
$instance = unserialize($this->laravel->make(Encrypter::class)->decrypt($payload['data']['command']));
}

if (! isset($instance)) {
throw new RuntimeException('Unable to extract job payload.');
}

if (is_object($instance) && method_exists($instance, 'retryUntil')) {
$retryUntil = $instance->retryUntil();
Expand Down

0 comments on commit 054c391

Please sign in to comment.