diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-09-16 17:22:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-21 21:58:06 +0100 |
commit | 2478a6f2084e0217983dafb6862b1ec4fd4f6049 (patch) | |
tree | 1e23dbdd6fb1d53708a799fca962afbfc9f51c36 /bitbake/lib/toaster/orm | |
parent | 483c16a7ceac6deda2654772a2bf2aab79f94470 (diff) | |
download | poky-2478a6f2084e0217983dafb6862b1ec4fd4f6049.tar.gz |
bitbake: toaster: implement signal_runbuilds function
This function reads pid of runbuilds process from
BUILDDIR/.runbuilds.pid and sends SIGUSR1 to it. signal_runbuilds
function will be used in Toaster code to notify runbuilds when
build is scheduled, finished or cancelled.
(Bitbake rev: 62955224a6d99e9f581d2bef924058070bfa4c43)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 8ee0c87376..38d014a7f8 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -33,9 +33,10 @@ from django.conf import settings | |||
33 | import django.db.models.signals | 33 | import django.db.models.signals |
34 | 34 | ||
35 | import sys | 35 | import sys |
36 | import os.path | 36 | import os |
37 | import re | 37 | import re |
38 | import itertools | 38 | import itertools |
39 | from signal import SIGUSR1 | ||
39 | 40 | ||
40 | import logging | 41 | import logging |
41 | logger = logging.getLogger("toaster") | 42 | logger = logging.getLogger("toaster") |
@@ -1736,6 +1737,11 @@ def invalidate_cache(**kwargs): | |||
1736 | except Exception as e: | 1737 | except Exception as e: |
1737 | logger.warning("Problem with cache backend: Failed to clear cache: %s" % e) | 1738 | logger.warning("Problem with cache backend: Failed to clear cache: %s" % e) |
1738 | 1739 | ||
1740 | def signal_runbuilds(): | ||
1741 | """Send SIGUSR1 to runbuilds process""" | ||
1742 | with open(os.path.join(os.getenv('BUILDDIR'), '.runbuilds.pid')) as pidf: | ||
1743 | os.kill(int(pidf.read()), SIGUSR1) | ||
1744 | |||
1739 | django.db.models.signals.post_save.connect(invalidate_cache) | 1745 | django.db.models.signals.post_save.connect(invalidate_cache) |
1740 | django.db.models.signals.post_delete.connect(invalidate_cache) | 1746 | django.db.models.signals.post_delete.connect(invalidate_cache) |
1741 | django.db.models.signals.m2m_changed.connect(invalidate_cache) | 1747 | django.db.models.signals.m2m_changed.connect(invalidate_cache) |