bugfix
This commit is contained in:
parent
52ae7b8187
commit
c0d901ec72
@ -14,7 +14,9 @@ class HttpClient:
|
||||
self.cookies = {}
|
||||
|
||||
async def close(self):
|
||||
await self.session.close()
|
||||
if self.session:
|
||||
await self.session.close()
|
||||
self.session = None
|
||||
|
||||
def url2domain(self,url):
|
||||
parts = url.split('/')[:3]
|
||||
|
@ -57,7 +57,8 @@ if __name__ == '__main__':
|
||||
|
||||
async def run():
|
||||
w = AsyncWorker()
|
||||
g = [ asyncio.create_task(w(hello,i,'hello world')) for i in range(100) ]
|
||||
f = awaitify(hello)
|
||||
g = [ asyncio.create_task(w(f,i,'hello world')) for i in range(100) ]
|
||||
await asyncio.wait(g)
|
||||
print('aaaaaaaaaaaaaaaaaaa')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user