Skip to content

Commit a83ede2

Browse files
committed
heartbeat
1 parent d5e26ba commit a83ede2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Protocols/Amqp.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,21 @@ protected function connect(): bool
272272

273273
[$host, $port] = explode(':', $host);
274274

275+
$heartbeat = $this->settings['heartbeat'] ?? null;
276+
275277
$credentials = [
276278
'host' => $host,
277279
'port' => $port,
278280
'vhost' => $this->settings['vhost'],
279281
'login' => $this->login,
280282
'password' => $this->password,
281283
'connect_timeout' => $this->settings['connect_timeout'] ?? 0,
282-
'heartbeat' => $this->settings['heartbeat'] ?? 0,
283284
];
284285

286+
if ($heartbeat !== null) {
287+
$credentials['heartbeat'] = $heartbeat;
288+
}
289+
285290
$link = new AMQPConnection($credentials);
286291

287292
try {

0 commit comments

Comments
 (0)