Skip to content

Commit

Permalink
fix: removed loop arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkryukov committed Apr 24, 2022
1 parent 03840f4 commit 02cf0ec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- (Internal) Added `pick_by` to helpers.
- (Telegram) Added support for `title` parameter in attachments (closes #66).
- Fixes
- ^? (Core) Removed loop argument in kutana's semaphore.
- ^? (Core) Removed loop arguments for Lock, Queue e.t.c.
- (Examples) "Document" now sends as actual document.
- (i18n) `collect_from` option is now used.
- (Telegram) `api_url` option is now used.
Expand Down
2 changes: 1 addition & 1 deletion kutana/backends/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async def on_start(self, app):

self.username = me["username"]

self.api_messages_lock = asyncio.Lock(loop=app.get_loop())
self.api_messages_lock = asyncio.Lock()

async def send_message(self, target_id, message, attachments=(), **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion kutana/backends/vkontakte/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def on_start(self, app):
await super().on_start(app)

# Setup queue
self.updates_queue = asyncio.Queue(self._queue_limit, loop=app.get_loop())
self.updates_queue = asyncio.Queue(self._queue_limit)

# Start web server
await self.start_server()
Expand Down
9 changes: 3 additions & 6 deletions kutana/kutana.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ async def _main_loop_wrapper(self):
raise

async def _main_loop(self):
queue = asyncio.Queue(
maxsize=self._concurrent_handlers_count,
loop=self._loop
)
queue = asyncio.Queue(maxsize=self._concurrent_handlers_count)

await self._on_start(queue)

Expand Down Expand Up @@ -245,7 +242,7 @@ async def _shutdown(self):

tasks.append(self._handle_event("shutdown"))

await asyncio.gather(*tasks, loop=self._loop, return_exceptions=True)
await asyncio.gather(*tasks, return_exceptions=True)

# Cancel everything else
tasks = []
Expand All @@ -255,7 +252,7 @@ async def _shutdown(self):
task.cancel()
tasks.append(task)

await asyncio.gather(*tasks, loop=self._loop, return_exceptions=True)
await asyncio.gather(*tasks, return_exceptions=True)

self._loop.stop()

Expand Down

0 comments on commit 02cf0ec

Please sign in to comment.