kopia lustrzana https://github.com/cirospaciari/socketify.py
fix last_run in loop.py
rodzic
76e96f978e
commit
1285619088
|
@ -60,10 +60,10 @@ class Loop:
|
|||
callback(user_data)
|
||||
loop.queue.task_done()
|
||||
#run once asyncio if has some current task running or relax CPU
|
||||
if not asyncio.current_task(loop.loop) is None or self.last_run >= 100:
|
||||
if not asyncio.current_task(loop.loop) is None or loop.last_run >= 100:
|
||||
loop.run_once_asyncio()
|
||||
self.last_run = 0
|
||||
self.last_run = self.last_run + 1
|
||||
loop.last_run = 0
|
||||
loop.last_run = loop.last_run + 1
|
||||
#use check for calling asyncio once per tick
|
||||
self.timer = self.uv_loop.create_timer(0, 1, tick, self)
|
||||
# self.timer = self.uv_loop.create_check(tick, self)
|
||||
|
|
Ładowanie…
Reference in New Issue