Skip to content

Commit d7bdab7

Browse files
committed
bugfix: syntax error
1 parent 43557dc commit d7bdab7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

emf/common/integrations/rabbit.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ def _on_term_signal(self, signum, _frame):
241241
def _process_messages(self, basic_deliver, properties, body):
242242
ack = True
243243
err = None
244-
properties.header['success'] == True
245244

246245
# Convert if needed
247246
if self.message_converter:
@@ -263,7 +262,7 @@ def _process_messages(self, basic_deliver, properties, body):
263262
try:
264263
logger.info(f"Handling message with handler: {message_handler.__class__.__name__}")
265264
body, properties = message_handler.handle(body, properties=properties, channel=None)
266-
if properties.header['success'] == False: # stop processing next handlers if message success was set to false
265+
if not properties.headers['success']: # stop processing next handlers if message success was set to false
267266
break
268267

269268
except Exception as error:
@@ -397,6 +396,7 @@ def __init__(self,
397396
self._vhost = vhost
398397
self._queue = queue
399398
self._username = username
399+
self.heartbeat = heartbeat
400400
self._executor = ThreadPoolExecutor()
401401
self._executor_stopped = False
402402

@@ -563,8 +563,7 @@ def on_consumer_cancelled(self, method_frame):
563563

564564
def _process_messages(self, basic_deliver, properties, body):
565565
ack = True
566-
properties.header['success'] == True
567-
566+
568567
# Convert if needed
569568
if self.message_converter:
570569
try:
@@ -583,7 +582,7 @@ def _process_messages(self, basic_deliver, properties, body):
583582
for message_handler in self.message_handlers:
584583
logger.info(f"Handling message with handler: {message_handler.__class__.__name__}")
585584
body, properties = message_handler.handle(body, properties=properties, channel=self._channel)
586-
if properties.header['success'] == False: # stop processing next handlers if message success was set to false
585+
if not properties.headers['success']: # stop processing next handlers if message success was set to false
587586
break
588587
except Exception as error:
589588
logger.error(f"Message handling failed: {error}", exc_info=True)

0 commit comments

Comments
 (0)