Skip to content

Commit

Permalink
fix: 修复同步api请求出现session没有关闭的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
veehou authored and hwygithub committed Mar 1, 2022
1 parent fb1329f commit 11caab4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions qqbot/async_api.py
Expand Up @@ -82,7 +82,6 @@ def async_listen_events(t_token: Token, is_sandbox: bool, *handlers: Handler):

class AsyncAPIBase:
timeout = 3
client_session = aiohttp.ClientSession()

def __init__(self, token: Token, is_sandbox: bool):
"""
Expand All @@ -94,7 +93,7 @@ def __init__(self, token: Token, is_sandbox: bool):
self.is_sandbox = is_sandbox
self.token = token
self.http_async = AsyncHttp(
self.client_session, self.timeout, token.get_string(), token.get_type()
aiohttp.ClientSession(), self.timeout, token.get_string(), token.get_type()
)

def with_timeout(self, timeout):
Expand Down

0 comments on commit 11caab4

Please sign in to comment.