Skip to content

Commit 5961c56

Browse files
committed
Allow disabling of heartbeats #69
If the hearbeat value is > 0, find the value between what the server wants and the client wants, otherwise use 0 per the client
1 parent 0cf4b82 commit 5961c56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rabbitpy/channel0.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,9 @@ def _on_connection_tune(self, frame_value):
260260
frame_value.frame_max)
261261
self._max_channels = self._negotiate(self._max_channels,
262262
frame_value.channel_max)
263-
self._heartbeat = self._negotiate(self._heartbeat,
264-
frame_value.heartbeat)
263+
if self._heartbeat > 0:
264+
self._heartbeat = self._negotiate(self._heartbeat,
265+
frame_value.heartbeat)
265266
if self._heartbeat:
266267
self._start_heartbeat_timer()
267268
self.write_frame(self._build_tune_ok_frame())

0 commit comments

Comments
 (0)