Skip to content

Commit

Permalink
remove validate-exchange fn
Browse files Browse the repository at this point in the history
  • Loading branch information
akashg3627 committed Mar 19, 2024
1 parent 88b6889 commit b2bb562
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions async_processor/amqp_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,6 @@ async def _get_channel(self) -> AbstractChannel:
self._ch = await connection.channel()
return self._ch

async def _validate_exchange_exists(self):
if not self._exchange_name:
return
channel = await self._get_channel()
try:
# https://aio-pika.readthedocs.io/en/latest/apidoc.html#aio_pika.Channel.get_exchange
self._exchange = await channel.get_exchange(
self._exchange_name, ensure=True
)
except ChannelNotFoundEntity as ex:
raise Exception(
f"Exchange {self._exchange_name!r} does not exist."
" Please create the exchange before running the async processor."
) from ex

async def __aenter__(self):
await self._get_exchange()
return self
Expand Down

0 comments on commit b2bb562

Please sign in to comment.