Skip to content

Commit

Permalink
Fix bug with RetryCommand (#35828)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Jan 8, 2021
1 parent b3ebb1b commit bd7aaa8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Illuminate/Queue/Console/RetryCommand.php
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Queue\Console;

use DateTimeInterface;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;

Expand Down Expand Up @@ -133,7 +134,11 @@ protected function refreshRetryUntil($payload)
$instance = unserialize($payload['data']['command']);

if (is_object($instance) && method_exists($instance, 'retryUntil')) {
$payload['retryUntil'] = $instance->retryUntil()->timestamp;
$retryUntil = $instance->retryUntil();

$payload['retryUntil'] = $retryUntil instanceof DateTimeInterface
? $retryUntil->getTimestamp()
: $retryUntil;
}

return json_encode($payload);
Expand Down

0 comments on commit bd7aaa8

Please sign in to comment.