1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

bitbake: event: Add enable/disable heartbeat code

Currently heartbeat events are always generated by the server whilst it is
active. Change this so they only appear when builds are running, which is
when most code would expect to be executed. This removes a number of races
around changes in the datastore which can happen outside of builds.

(Bitbake rev: 8c36c90afc392980d999a981a924dc7d22e2766e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2022-12-20 14:17:49 +00:00
parent 2c5bc03796
commit cb8efd4d20
3 changed files with 15 additions and 2 deletions
+9
View File
@@ -69,6 +69,7 @@ _eventfilter = None
_uiready = False
_thread_lock = threading.Lock()
_thread_lock_enabled = False
_heartbeat_enabled = False
def enable_threadlock():
global _thread_lock_enabled
@@ -78,6 +79,14 @@ def disable_threadlock():
global _thread_lock_enabled
_thread_lock_enabled = False
def enable_heartbeat():
global _heartbeat_enabled
_heartbeat_enabled = True
def disable_heartbeat():
global _heartbeat_enabled
_heartbeat_enabled = False
def execute_handler(name, handler, event, d):
event.data = d
try: