summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-10-28 18:48:47 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-04 12:50:55 +0000
commit8e70fa1d7933f36244badb34c28ab67f8f159d74 (patch)
tree2b062adc86cab57c73d6b9436abe000699a2b829
parent0c91a400e7341d1cbfd7950067ca5c15a7b38691 (diff)
downloadpoky-8e70fa1d7933f36244badb34c28ab67f8f159d74.tar.gz
bitbake: toaster: orm models Handle run builds process not yet running
During tests we may want to call the runbuilds process manually for example when doing a "one shot" approach rather than a long running process during tests. (Bitbake rev: 60d3f93836da5523705b0b2e25567d1c9040ec89) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/orm/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index a7de57c256..9a4db1e856 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1741,8 +1741,12 @@ def invalidate_cache(**kwargs):
1741 1741
1742def signal_runbuilds(): 1742def signal_runbuilds():
1743 """Send SIGUSR1 to runbuilds process""" 1743 """Send SIGUSR1 to runbuilds process"""
1744 with open(os.path.join(os.getenv('BUILDDIR'), '.runbuilds.pid')) as pidf: 1744 try:
1745 os.kill(int(pidf.read()), SIGUSR1) 1745 with open(os.path.join(os.getenv('BUILDDIR'),
1746 '.runbuilds.pid')) as pidf:
1747 os.kill(int(pidf.read()), SIGUSR1)
1748 except FileNotFoundError:
1749 logger.info("Stopping existing runbuilds: no current process found")
1746 1750
1747django.db.models.signals.post_save.connect(invalidate_cache) 1751django.db.models.signals.post_save.connect(invalidate_cache)
1748django.db.models.signals.post_delete.connect(invalidate_cache) 1752django.db.models.signals.post_delete.connect(invalidate_cache)