Skip to content

Commit

Permalink
Merge pull request #11 from wandoubaba/patch-1
Browse files Browse the repository at this point in the history
Update Client.php
  • Loading branch information
walkor authored Jun 8, 2022
2 parents fbab7ef + e00ff7b commit 38d065d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ public function connect()
return $this->connectionOpen($this->options["vhost"]);

})->then(function () {
$this->heartbeatTimer = Timer::add($this->options["heartbeat"], [$this, "onHeartbeat"]);
if (isset($this->options["heartbeat"]) && $this->options["heartbeat"] > 0) {
$this->heartbeatTimer = Timer::add($this->options["heartbeat"], [$this, "onHeartbeat"]);
}

$this->state = ClientStateEnum::CONNECTED;
return $this;
Expand Down

0 comments on commit 38d065d

Please sign in to comment.