diff --git a/src/cli/VerboseBehavior.php b/src/cli/VerboseBehavior.php index 4f421b383..742ab0cda 100644 --- a/src/cli/VerboseBehavior.php +++ b/src/cli/VerboseBehavior.php @@ -63,6 +63,7 @@ public function beforeExec(ExecEvent $event) $this->command->stdout($this->jobTitle($event), Console::FG_GREY); $this->command->stdout(' - ', Console::FG_YELLOW); $this->command->stdout('Started', Console::FG_GREEN); + $this->command->stdout(' (params:' . json_encode($event->job, JSON_UNESCAPED_UNICODE) . ')'); $this->command->stdout(PHP_EOL); } diff --git a/src/drivers/amqp_interop/Queue.php b/src/drivers/amqp_interop/Queue.php index 23383c4c0..e008b21c5 100644 --- a/src/drivers/amqp_interop/Queue.php +++ b/src/drivers/amqp_interop/Queue.php @@ -20,6 +20,7 @@ use Interop\Amqp\AmqpQueue; use Interop\Amqp\AmqpTopic; use Interop\Amqp\Impl\AmqpBind; +use Yii; use yii\base\Application as BaseApp; use yii\base\Event; use yii\base\NotSupportedException; @@ -295,8 +296,7 @@ public function init() $oldHandler($signal); } - pcntl_signal($signal, SIG_DFL); - posix_kill(posix_getpid(), $signal); + Yii::$app->end(); }); } } @@ -314,6 +314,7 @@ public function listen() $consumer = $this->context->createConsumer($queue); $callback = function (AmqpMessage $message, AmqpConsumer $consumer) { + pcntl_signal_dispatch(); if ($message->isRedelivered()) { $consumer->acknowledge($message); @@ -332,6 +333,7 @@ public function listen() $this->redeliver($message); } + pcntl_signal_dispatch(); return true; };