File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ public static function create(string $dsn): self
5050 parse_str ($ components ['query ' ], $ options );
5151 }
5252
53+ if (PHP_SAPI !== 'cli ' ) {
54+ $ options ['heartbeat ' ] = 0 ;
55+ }
56+
5357 return new self ([$ components ], $ options );
5458 }
5559
@@ -62,7 +66,7 @@ public function connect(): AMQPChannel
6266 /** @var AMQPStreamConnection $connection */
6367 $ connection = AMQPStreamConnection::create_connection ($ this ->hosts , $ this ->options );
6468
65- if (PHP_SAPI === ' cli ' && $ connection ->getHeartbeat () > 0 ) {
69+ if ($ connection ->getHeartbeat () > 0 ) {
6670 $ this ->heartbeats = match ($ this ->options ['heartbeat_sender ' ] ?? null ) {
6771 'sig ' => new Heartbeat \SIGHeartbeatSender ($ connection ),
6872 default => new Heartbeat \PCNTLHeartbeatSender ($ connection ),
You can’t perform that action at this time.
0 commit comments