summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-09-16 17:22:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-20 15:18:51 +0100
commit62d598cc5aa01d23f1e9284e9e926bd55b1d1878 (patch)
tree2682fe33b9f24ab4152caea719bc503641834e38
parentfe08f0fa4b328908e73695ebbceca87bc86a49f9 (diff)
downloadbitbake-contrib-62d598cc5aa01d23f1e9284e9e926bd55b1d1878.tar.gz
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] 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>
-rw-r--r--lib/toaster/bldcontrol/management/commands/runbuilds.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/toaster/bldcontrol/management/commands/runbuilds.py b/lib/toaster/bldcontrol/management/commands/runbuilds.py
index a70377012..61a520c6c 100644
--- a/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -11,9 +11,9 @@ from orm.models import Build, ToasterSetting, LogMessage, Target
import os
import logging
-import time
import sys
import traceback
+import signal
logger = logging.getLogger("toaster")
@@ -175,6 +175,8 @@ class Command(NoArgsCommand):
logger.warn("runbuilds: schedule exception %s" % str(e))
def handle_noargs(self, **options):
+ signal.signal(signal.SIGUSR1, lambda sig, frame: None)
+
while True:
+ signal.pause()
self.runbuild()
- time.sleep(1)