From 7b4ad2d0346037c419e40eecd83feb992c8f339f Mon Sep 17 00:00:00 2001 From: chaz6chez <250220719@qq.com> Date: Mon, 5 Sep 2022 18:07:07 +0800 Subject: [PATCH] fixed #1 --- src/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index 140d618..e22bdca 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -18,7 +18,7 @@ function sync_publish(FastBuilder $builder, string $body, ?array $headers = null { $message = $builder->getMessage(); if( - ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 1) or + ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 0) or ($message->getExchangeType() === Constants::DELAYED and !($headers['x-delay'] ?? 0)) ){ throw new WebmanRabbitMQException('Invalid publish. '); @@ -42,7 +42,7 @@ function async_publish(FastBuilder $builder, string $body, ?array $headers = nul { $message = $builder->getMessage(); if( - ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 1) or + ($message->getExchangeType() !== Constants::DELAYED and $headers['x-delay'] ?? 0) or ($message->getExchangeType() === Constants::DELAYED and !($headers['x-delay'] ?? 0)) ){ throw new WebmanRabbitMQException('Invalid publish. ');