mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +00:00
destroy_temp_session is awaitable
This commit is contained in:
parent
f047bb6db3
commit
9e97cd6727
2 changed files with 4 additions and 4 deletions
|
|
@ -110,7 +110,7 @@ class BaseBot:
|
|||
self._temp_sessions.append(session)
|
||||
return session
|
||||
|
||||
def destroy_temp_session(self, session: aiohttp.ClientSession):
|
||||
async def destroy_temp_session(self, session: aiohttp.ClientSession):
|
||||
"""
|
||||
Destroy temporary session
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ class BaseBot:
|
|||
:type session: :obj:`aiohttp.ClientSession`
|
||||
"""
|
||||
if not session.closed:
|
||||
session.close()
|
||||
await session.close()
|
||||
if session in self._temp_sessions:
|
||||
self._temp_sessions.remove(session)
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ class BaseBot:
|
|||
dest.seek(0)
|
||||
return dest
|
||||
finally:
|
||||
self.destroy_temp_session(session)
|
||||
await self.destroy_temp_session(session)
|
||||
|
||||
async def send_file(self, file_type, method, file, payload) -> Union[Dict, base.Boolean]:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue