Skip to content

Commit 0cf4b82

Browse files
committed
Merge pull request #68 from kmelnikov/master
Cancel consuming in case of exceptions
2 parents f02ba91 + 1a55432 commit 0cf4b82

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rabbitpy/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def write_frame(self, frame):
232232
"""
233233
if self.closed:
234234
return
235-
self._check_for_exceptions()
235+
#self._check_for_exceptions()
236236
if self._is_debugging:
237237
LOGGER.debug('Writing frame: %s', frame.name)
238238
with self._write_lock:
@@ -428,7 +428,11 @@ def _wait_on_frame(self, frame_type=None):
428428
return value
429429
self._read_queue.put(value)
430430

431-
self._check_for_exceptions()
431+
try:
432+
self._check_for_exceptions()
433+
except:
434+
self._waiting = False
435+
raise
432436

433437
# If the wait interrupt is set, break out of the loop
434438
if self._wait_on_frame_interrupt.is_set():

0 commit comments

Comments
 (0)