mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Deprecate temp sessions.
This commit is contained in:
parent
8f9240f7ea
commit
a941a00abc
1 changed files with 3 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ from typing import Dict, List, Optional, Union
|
|||
import aiohttp
|
||||
import certifi
|
||||
|
||||
from aiogram.utils.deprecated import deprecated
|
||||
from . import api
|
||||
from ..types import ParseMode, base
|
||||
from ..utils import json
|
||||
|
|
@ -93,6 +94,7 @@ class BaseBot:
|
|||
if not session.closed:
|
||||
await session.close()
|
||||
|
||||
@deprecated('Manually you may use `aiohttp.ClientSession` instead of temp session')
|
||||
def create_temp_session(self, limit: base.Integer = 1, force_close: base.Boolean = False) -> aiohttp.ClientSession:
|
||||
"""
|
||||
Create temporary session
|
||||
|
|
@ -110,6 +112,7 @@ class BaseBot:
|
|||
self._temp_sessions.append(session)
|
||||
return session
|
||||
|
||||
@deprecated('Manually you may use `aiohttp.ClientSession` instead of temp session')
|
||||
async def destroy_temp_session(self, session: aiohttp.ClientSession):
|
||||
"""
|
||||
Destroy temporary session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue