Permalink
Browse files

Disable heartbeats by default

  • Loading branch information...
1 parent 921a5ba commit b678e92cb0aec20d1e945e28f94238022f01362a @oldpatricka oldpatricka committed Jan 7, 2013
Showing with 5 additions and 2 deletions.
  1. +4 −1 dashi/__init__.py
  2. +1 −1 dashi/tests/test_dashi.py
View
@@ -17,7 +17,7 @@
log = logging.getLogger(__name__)
-DEFAULT_HEARTBEAT = 30
+DEFAULT_HEARTBEAT = None # Disabled for now
class DashiConnection(object):
@@ -295,6 +295,9 @@ def _consume_one(self, timeout=None):
inner_timeout = timeout - elapsed
def heartbeat(self):
+ if self._dashi._heartbeat_interval is None:
+ return
+
time_between_tics = timedelta(seconds=self._dashi._heartbeat_interval / 2)
if self._dashi.consumer_timeout > time_between_tics.seconds:
@@ -372,7 +372,7 @@ def test_handle_sender_kwarg(self):
def test_heartbeats(self):
receiver = TestReceiver(uri=self.uri, exchange="x1",
- transport_options=self.transport_options)
+ transport_options=self.transport_options, heartbeat=30)
receiver.conn.consumer_timeout = 100
receiver.handle("test1", "hello", sender_kwarg="sender")

0 comments on commit b678e92

Please sign in to comment.