diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-09-16 17:22:31 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-21 21:58:06 +0100 |
commit | 64d284b26c2e9b0fcd03119302bd8512fe317cc1 (patch) | |
tree | 17fad7faf8b896cfc8ddbc8c522b81382b7ea9a3 /bitbake/lib/toaster/bldcontrol | |
parent | e9a12e5d37390632ac6f265f9513106f00ccdbb9 (diff) | |
download | poky-64d284b26c2e9b0fcd03119302bd8512fe317cc1.tar.gz |
bitbake: runbuilds: process builds on SIGUSR1
Run main processing function 'runbuild' only if SIGUSR1 is
received. This signal is sent by Toaster when build status
is changed (either started, cancelled or finished).
This should stop continuous database polling as run_builds function
will be called only when needed, i.e. after build status is changed.
[YOCTO #8918]
(Bitbake rev: 62d598cc5aa01d23f1e9284e9e926bd55b1d1878)
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/bldcontrol')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index a70377012b..61a520c6ce 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | |||
@@ -11,9 +11,9 @@ from orm.models import Build, ToasterSetting, LogMessage, Target | |||
11 | 11 | ||
12 | import os | 12 | import os |
13 | import logging | 13 | import logging |
14 | import time | ||
15 | import sys | 14 | import sys |
16 | import traceback | 15 | import traceback |
16 | import signal | ||
17 | 17 | ||
18 | logger = logging.getLogger("toaster") | 18 | logger = logging.getLogger("toaster") |
19 | 19 | ||
@@ -175,6 +175,8 @@ class Command(NoArgsCommand): | |||
175 | logger.warn("runbuilds: schedule exception %s" % str(e)) | 175 | logger.warn("runbuilds: schedule exception %s" % str(e)) |
176 | 176 | ||
177 | def handle_noargs(self, **options): | 177 | def handle_noargs(self, **options): |
178 | signal.signal(signal.SIGUSR1, lambda sig, frame: None) | ||
179 | |||
178 | while True: | 180 | while True: |
181 | signal.pause() | ||
179 | self.runbuild() | 182 | self.runbuild() |
180 | time.sleep(1) | ||