Skip to content

Commit

Permalink
Clean: fix function name
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleytrf committed Mar 18, 2024
1 parent 54da318 commit 8fcf3bb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions async_processor/amqp_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ def __init__(self, config: AMQPInputConfig):
self._ch = None
self._queue = None

async def _validate_consumer_exists(self):
async def _validate_queue_exists(self):
channel = await self._get_channel()
try:
self._queue = await channel.declare_queue(self._queue_name, passive=True)
except ChannelNotFoundEntity as ex:
raise Exception(
f"Consumer {self._queue_name!r} does not exist."
" Please create the consumer before running the async processor."
f"Queue {self._queue_name!r} does not exist."
" Please create the queue before running the async processor."
) from ex

async def __aenter__(self):
await self._validate_consumer_exists()
await self._validate_queue_exists()
return self

async def _get_connect(self) -> AbstractConnection:
Expand Down Expand Up @@ -109,18 +109,18 @@ def __init__(self, config: AMQPOutputConfig):
self._nc = None
self._ch = None

async def _validate_consumer_exists(self):
async def _validate_queue_exists(self):
channel = await self._get_channel()
try:
self._queue = await channel.declare_queue(self._queue_name, passive=True)
except ChannelNotFoundEntity as ex:
raise Exception(
f"Consumer {self._queue_name!r} does not exist."
" Please create the consumer before running the async processor."
f"Queue {self._queue_name!r} does not exist."
" Please create the queue before running the async processor."
) from ex

async def __aenter__(self):
await self._validate_consumer_exists()
await self._validate_queue_exists()
return self

async def _get_connect(self) -> AbstractConnection:
Expand Down

0 comments on commit 8fcf3bb

Please sign in to comment.