From 38ed92545f80e4a964db0510a2c0ee6dcf9b22d7 Mon Sep 17 00:00:00 2001 From: Witold Wasiczko Date: Wed, 20 Feb 2019 16:57:52 +0100 Subject: [PATCH 1/2] Catch signal in Bunny adapter --- pkg/amqp-bunny/AmqpSubscriptionConsumer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/amqp-bunny/AmqpSubscriptionConsumer.php b/pkg/amqp-bunny/AmqpSubscriptionConsumer.php index 6d7a49469..b8b8922de 100644 --- a/pkg/amqp-bunny/AmqpSubscriptionConsumer.php +++ b/pkg/amqp-bunny/AmqpSubscriptionConsumer.php @@ -47,7 +47,7 @@ public function consume(int $timeout = 0): void try { $this->context->getBunnyChannel()->getClient()->run(0 !== $timeout ? $timeout / 1000 : null); } catch (ClientException $e) { - if ('stream_select() failed.' == $e->getMessage() && $signalHandler->wasThereSignal()) { + if ('stream_select() failed' === substr($e->getMessage(), 0, 22) && $signalHandler->wasThereSignal()) { return; } From 62cb94953ce1b870e1c3682f241fe385322a93d9 Mon Sep 17 00:00:00 2001 From: Witold Wasiczko Date: Thu, 21 Feb 2019 00:33:31 +0100 Subject: [PATCH 2/2] CR fix --- pkg/amqp-bunny/AmqpSubscriptionConsumer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/amqp-bunny/AmqpSubscriptionConsumer.php b/pkg/amqp-bunny/AmqpSubscriptionConsumer.php index b8b8922de..4fff4f8ab 100644 --- a/pkg/amqp-bunny/AmqpSubscriptionConsumer.php +++ b/pkg/amqp-bunny/AmqpSubscriptionConsumer.php @@ -47,7 +47,7 @@ public function consume(int $timeout = 0): void try { $this->context->getBunnyChannel()->getClient()->run(0 !== $timeout ? $timeout / 1000 : null); } catch (ClientException $e) { - if ('stream_select() failed' === substr($e->getMessage(), 0, 22) && $signalHandler->wasThereSignal()) { + if (0 === strpos($e->getMessage(), 'stream_select() failed') && $signalHandler->wasThereSignal()) { return; }