Skip to content

Commit aaadba1

Browse files
committed
fixed #34
1 parent 682a6ef commit aaadba1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Clients/AsyncClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use Bunny\Protocol\MethodConnectionStartFrame;
1212
use React\Promise\PromiseInterface;
1313
use Workbunny\WebmanRabbitMQ\Clients\Traits\ClientMethods;
14-
use Workerman\Lib\Timer;
1514
use Workerman\RabbitMQ\Client;
15+
use Workerman\Timer;
1616
use Workerman\Worker;
1717

1818
class AsyncClient extends Client
@@ -62,7 +62,7 @@ public function __destruct()
6262
/** @inheritdoc */
6363
public function disconnect($replyCode = 0, $replyText = ""): PromiseInterface
6464
{
65-
if ($this->heartbeatTimer) {
65+
if ($this->heartbeatTimer and is_int($this->heartbeatTimer)) {
6666
Timer::del($this->heartbeatTimer);
6767
$this->heartbeatTimer = null;
6868
}
@@ -94,7 +94,7 @@ public function syncDisconnect(int|string $replyCode = 0, int|string $replyText
9494
}
9595
}
9696

97-
if ($this->heartbeatTimer) {
97+
if ($this->heartbeatTimer and is_int($this->heartbeatTimer)) {
9898
Timer::del($this->heartbeatTimer);
9999
$this->heartbeatTimer = null;
100100
}

0 commit comments

Comments
 (0)