File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file.
44
5+ ## [ 10.0.2 (2019-12-13)] ( https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v10.0.1...v10.0.2 )
6+
7+ - Finally fix [ #235 ] ( https://github.com/vyuldashev/laravel-queue-rabbitmq/issues/235 )
8+
59## [ 10.0.1 (2019-12-13)] ( https://github.com/vyuldashev/laravel-queue-rabbitmq/compare/v10.0.0...v10.0.1 )
610
711- Add missing container instance and connectionName to RabbitMQJob
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ class RabbitMQQueue extends Queue implements QueueContract
6060 */
6161 protected $ boundQueues = [];
6262
63+ /**
64+ * Current job being processed.
65+ *
66+ * @var RabbitMQJob
67+ */
68+ protected $ currentJob ;
69+
6370 public function __construct (
6471 AbstractConnection $ connection ,
6572 string $ default
@@ -198,7 +205,7 @@ public function pop($queue = null)
198205
199206 /** @var AMQPMessage|null $message */
200207 if ($ message = $ this ->channel ->basic_get ($ queue )) {
201- return new RabbitMQJob (
208+ return $ this -> currentJob = new RabbitMQJob (
202209 $ this ->container ,
203210 $ this ,
204211 $ message ,
@@ -398,6 +405,10 @@ protected function getRandomId(): string
398405 */
399406 public function close (): void
400407 {
408+ if ($ this ->currentJob ) {
409+ $ this ->reject ($ this ->currentJob );
410+ }
411+
401412 $ this ->connection ->close ();
402413 }
403414}
You can’t perform that action at this time.
0 commit comments