Use get_running_loop() instead of deprecated get_event_loop()
This commit is contained in:
parent
e8f16ca18a
commit
da176a1363
1 changed files with 3 additions and 2 deletions
|
|
@ -172,11 +172,12 @@ class IFSession:
|
|||
|
||||
buf = b""
|
||||
idle_timeout = 0.1 # return quickly once data stops flowing
|
||||
overall_deadline = asyncio.get_event_loop().time() + 5.0
|
||||
loop = asyncio.get_running_loop()
|
||||
overall_deadline = loop.time() + 5.0
|
||||
|
||||
try:
|
||||
while True:
|
||||
remaining = overall_deadline - asyncio.get_event_loop().time()
|
||||
remaining = overall_deadline - loop.time()
|
||||
if remaining <= 0:
|
||||
break
|
||||
timeout = min(idle_timeout, remaining)
|
||||
|
|
|
|||
Loading…
Reference in a new issue