File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -16,27 +16,23 @@ class CallQueuedHandler extends LaravelHandler {
16
16
*/
17
17
protected function dispatchThroughMiddleware (Job $ job , $ command )
18
18
{
19
- if ($ this ->hasExpired ($ command , $ job ->timestamp ())) {
20
- throw new ExpiredJobException ("This job has already expired " );
19
+ if (property_exists ( $ command , ' class ' ) && $ this ->hasExpired ($ command-> class , $ job ->timestamp ())) {
20
+ throw new ExpiredJobException ("Job { $ command -> class } has already expired " );
21
21
}
22
22
23
23
return parent ::dispatchThroughMiddleware ($ job , $ command );
24
24
}
25
25
26
26
/**
27
- * @param $command
27
+ * @param $className
28
28
* @param $queuedAt
29
29
* @return bool
30
30
*/
31
- protected function hasExpired ($ command , $ queuedAt ) {
32
- if (! property_exists ($ command , 'class ' )) {
31
+ protected function hasExpired ($ className , $ queuedAt ) {
32
+ if (! property_exists ($ className , 'retention ' )) {
33
33
return false ;
34
34
}
35
35
36
- if (! property_exists ($ command ->class , 'retention ' )) {
37
- return false ;
38
- }
39
-
40
- return time () > $ queuedAt + $ command ->class ::$ retention ;
36
+ return time () > $ queuedAt + $ className ::$ retention ;
41
37
}
42
38
}
You can’t perform that action at this time.
0 commit comments