Skip to content

Commit

Permalink
#804 at least warning about mismatch between exchange and post_excha…
Browse files Browse the repository at this point in the history
…nge in a poll
  • Loading branch information
petersilva committed Nov 6, 2023
1 parent 41c905c commit 24a9c7d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sarracenia/flow/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ def __init__(self, options):

super().__init__(options)

if hasattr(self.o,'post_exchange') and hasattr(self.o,'exchange'):
px = self.o.post_exchange if type(self.o.post_exchange) != list else self.o.post_exchange[0]
if px != self.o.exchange:
logger.warning( f"post_exchange: {px} is different from exchange: {self.o.exchange}. The settings need for multiple instances to share a poll." )
else:
logger.info( f"Good! post_exchange: {px} and exchange: {self.o.exchange} match so multiple instances to share a poll." )

if not 'poll' in ','.join(self.plugins['load']):
logger.info( f"adding poll plugin, because missing from: {self.plugins['load']}" )
self.plugins['load'].append('sarracenia.flowcb.poll.Poll')
Expand Down

0 comments on commit 24a9c7d

Please sign in to comment.