Skip to content

Commit 45eb7a7

Browse files
committed
formatting
1 parent cdcc60b commit 45eb7a7

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

src/Illuminate/Queue/Console/RetryCommand.php

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,14 @@ protected function getJobIdsByRanges(array $ranges)
9393
protected function retryJob($job)
9494
{
9595
$this->laravel['queue']->connection($job->connection)->pushRaw(
96-
$this->retryRefresh($job->payload), $job->queue
96+
$this->refreshRetryUntil($this->resetAttempts($job->payload)), $job->queue
9797
);
9898
}
9999

100-
/**
101-
* Possibly refresh job attempts and retryUntil value.
102-
*
103-
* @param string $payload
104-
* @return string
105-
*/
106-
protected function retryRefresh($payload)
107-
{
108-
$payload = $this->resetAttempts($payload);
109-
110-
$payload = $this->refreshRetryUntil($payload);
111-
112-
return $payload;
113-
}
114-
115100
/**
116101
* Reset the payload attempts.
117102
*
118-
* Applicable to Redis jobs which store attempts in their payload.
103+
* Applicable to Redis and other jobs which store attempts in their payload.
119104
*
120105
* @param string $payload
121106
* @return string
@@ -132,7 +117,7 @@ protected function resetAttempts($payload)
132117
}
133118

134119
/**
135-
* Refreshes a jobs retryUntil time with it's own retryUntil method.
120+
* Refresh the "retry until" timestamp for the job.
136121
*
137122
* @param string $payload
138123
* @return string
@@ -141,12 +126,10 @@ protected function refreshRetryUntil($payload)
141126
{
142127
$payload = json_decode($payload, true);
143128

144-
$jobInstance = unserialize($payload['data']['command']);
145-
146-
if (method_exists($jobInstance, 'retryUntil')) {
147-
$newRetryUntil = $jobInstance->retryUntil()->timestamp;
129+
$instance = unserialize($payload['data']['command']);
148130

149-
$payload['retryUntil'] = $newRetryUntil;
131+
if (is_object($instance) && method_exists($instance, 'retryUntil')) {
132+
$payload['retryUntil'] = $instance->retryUntil()->timestamp;
150133
}
151134

152135
return json_encode($payload);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy