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