File tree 1 file changed +9
-3
lines changed
pkg/enqueue/Consumption/Extension
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class SignalExtension implements ExtensionInterface
18
18
protected $ interruptConsumption = false ;
19
19
20
20
/**
21
- * @var LoggerInterface
21
+ * @var LoggerInterface|null
22
22
*/
23
23
protected $ logger ;
24
24
@@ -84,7 +84,10 @@ public function onIdle(Context $context)
84
84
public function interruptExecutionIfNeeded (Context $ context )
85
85
{
86
86
if (false == $ context ->isExecutionInterrupted () && $ this ->interruptConsumption ) {
87
- $ this ->logger ->debug ('[SignalExtension] Interrupt execution ' );
87
+ if ($ this ->logger ) {
88
+ $ this ->logger ->debug ('[SignalExtension] Interrupt execution ' );
89
+ }
90
+
88
91
$ context ->setExecutionInterrupted ($ this ->interruptConsumption );
89
92
90
93
$ this ->interruptConsumption = false ;
@@ -104,7 +107,10 @@ public function handleSignal($signal)
104
107
case SIGTERM : // 15 : supervisor default stop
105
108
case SIGQUIT : // 3 : kill -s QUIT
106
109
case SIGINT : // 2 : ctrl+c
107
- $ this ->logger ->debug ('[SignalExtension] Interrupt consumption ' );
110
+ if ($ this ->logger ) {
111
+ $ this ->logger ->debug ('[SignalExtension] Interrupt consumption ' );
112
+ }
113
+
108
114
$ this ->interruptConsumption = true ;
109
115
break ;
110
116
default :
You can’t perform that action at this time.
0 commit comments