Skip to content

Commit 4110a7e

Browse files
authored
Enable heartbeat only in workers (#35)
1 parent 5757c9b commit 4110a7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Remote/AMQP/Connector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function connect(): AMQPChannel
6262
/** @var AMQPStreamConnection $connection */
6363
$connection = AMQPStreamConnection::create_connection($this->hosts, $this->options);
6464

65-
if ($connection->getHeartbeat() > 0) {
65+
if (PHP_SAPI === 'cli' && $connection->getHeartbeat() > 0) {
6666
$this->heartbeats = match ($this->options['heartbeat_sender'] ?? null) {
6767
'sig' => new Heartbeat\SIGHeartbeatSender($connection),
6868
default => new Heartbeat\PCNTLHeartbeatSender($connection),

0 commit comments

Comments
 (0)