@@ -88,7 +88,7 @@ public function daemon($connectionName, $queue, WorkerOptions $options)
8888 $ this ->channel ->basic_qos (
8989 $ this ->prefetchSize ,
9090 $ this ->prefetchCount ,
91- null
91+ false
9292 );
9393
9494 $ jobClass = $ connection ->getJobClass ();
@@ -147,7 +147,7 @@ function (AMQPMessage $message) use ($connection, $options, $connectionName, $qu
147147 } catch (AMQPRuntimeException $ exception ) {
148148 $ this ->exceptions ->report ($ exception );
149149
150- $ this ->kill (1 );
150+ $ this ->kill (self :: EXIT_ERROR , $ options );
151151 } catch (Exception |Throwable $ exception ) {
152152 $ this ->exceptions ->report ($ exception );
153153
@@ -171,7 +171,7 @@ function (AMQPMessage $message) use ($connection, $options, $connectionName, $qu
171171 );
172172
173173 if (! is_null ($ status )) {
174- return $ this ->stop ($ status );
174+ return $ this ->stop ($ status, $ options );
175175 }
176176
177177 $ this ->currentJob = null ;
@@ -195,14 +195,15 @@ protected function daemonShouldRun(WorkerOptions $options, $connectionName, $que
195195 * Stop listening and bail out of the script.
196196 *
197197 * @param int $status
198+ * @param WorkerOptions|null $options
198199 * @return int
199200 */
200- public function stop ($ status = 0 ): int
201+ public function stop ($ status = 0 , $ options = null )
201202 {
202203 // Tell the server you are going to stop consuming.
203204 // It will finish up the last message and not send you any more.
204205 $ this ->channel ->basic_cancel ($ this ->consumerTag , false , true );
205206
206- return parent ::stop ($ status );
207+ return parent ::stop ($ status, $ options );
207208 }
208209}
0 commit comments