frontends (tools/aio): Fix excessive use of CPU:
Use a short delay instead of `loop.call_soonloop.call_soon` when work as been done, as this was resulting in an excessive use of CPU.
This commit is contained in:
parent
08e1409925
commit
0a8bb228d5
1 changed files with 3 additions and 2 deletions
|
|
@ -141,8 +141,9 @@ def install_glib_asyncio_iteration():
|
||||||
if iteration_count == 0:
|
if iteration_count == 0:
|
||||||
loop.call_later(0.01, _glib_iteration)
|
loop.call_later(0.01, _glib_iteration)
|
||||||
else:
|
else:
|
||||||
# Schedule ourselves to run again on the next asyncio loop iteration
|
# Work has been done, and there may still be some. Use a shorter delay to
|
||||||
loop.call_soon(_glib_iteration)
|
# schedule ourselves again.
|
||||||
|
loop.call_later(0.001, _glib_iteration)
|
||||||
|
|
||||||
# Kick off the GLib iteration
|
# Kick off the GLib iteration
|
||||||
loop.call_soon(_glib_iteration)
|
loop.call_soon(_glib_iteration)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue