Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fosterseth authored and bigfootjon committed Sep 3, 2024
1 parent 485f9a9 commit 847f735
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions channels/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ async def __call__(self, scope, receive, send):
# Handler to call when dispatch task is cancelled
cancel_callback = None
try:
if callable(self.channel_layer.clean_channel):
cancel_callback = functools.partial(self.channel_layer.clean_channel, self.channel_name)
if callable(self.channel_layer.clean_channel):
cancel_callback = functools.partial(
self.channel_layer.clean_channel, self.channel_name
)
except AttributeError:
pass
pass
# Store send function
if self._sync:
self.base_send = async_to_sync(send)
Expand All @@ -63,7 +65,9 @@ async def __call__(self, scope, receive, send):
try:
if self.channel_layer is not None:
await await_many_dispatch(
[receive, self.channel_receive], self.dispatch, cancel_callback=cancel_callback
[receive, self.channel_receive],
self.dispatch,
cancel_callback=cancel_callback,
)
else:
await await_many_dispatch([receive], self.dispatch)
Expand Down

0 comments on commit 847f735

Please sign in to comment.