Skip to content

Commit

Permalink
Open session
Browse files Browse the repository at this point in the history
  • Loading branch information
Issei Horie committed Jun 23, 2019
1 parent 0e859e6 commit b9a55f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions typetalk/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ async def request(self, route, **kwargs):

kwargs['headers'] = headers

if self.__session is None:
self.__session = aiohttp.ClientSession(loop=self.loop)

await lock.acquire()
async with self.__session.request(method, url, **kwargs) as r:
data = await json_or_text(r)
return data

def simple_login(self):
self.__session = aiohttp.ClientSession(loop=self.loop)

0 comments on commit b9a55f7

Please sign in to comment.