aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/main.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-07-19 23:20:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-21 07:48:35 +0100
commit5fa0b3a19e7d0f40790f737abeddf499d53f1f6a (patch)
tree6f17f9802ffa93c2f5e44ca743130069a1310edd /lib/bb/main.py
parent9d4254be5853a546a346bf0d19919dcfba12773d (diff)
downloadbitbake-contrib-5fa0b3a19e7d0f40790f737abeddf499d53f1f6a.tar.gz
bitbake: implement idle timeout for xmlrpc server
Idle timeout can be specified either by -T/--idle-timeout option or by sessing BBTIMEOUT environment variable. Bitbake xmlrpc server will unload itself when timeout exprired, i.e. when server is idle for more than <idle timeout> seconds. [YOCTO #5534] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/main.py')
-rwxr-xr-xlib/bb/main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/main.py b/lib/bb/main.py
index 849cade8c..7f7d87bd0 100755
--- a/lib/bb/main.py
+++ b/lib/bb/main.py
@@ -253,6 +253,10 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
parser.add_option("-B", "--bind", action="store", dest="bind", default=False,
help="The name/address for the bitbake server to bind to.")
+ parser.add_option("-T", "--idle-timeout", type=int,
+ default=int(os.environ.get("BBTIMEOUT", "0")),
+ help="Set timeout to unload bitbake server due to inactivity")
+
parser.add_option("", "--no-setscene", action="store_true",
dest="nosetscene", default=False,
help="Do not run any setscene tasks. sstate will be ignored and "
@@ -337,7 +341,8 @@ def start_server(servermodule, configParams, configuration, features):
single_use = not configParams.server_only and os.getenv('BBSERVER') != 'autostart'
if configParams.bind:
(host, port) = configParams.bind.split(':')
- server.initServer((host, int(port)), single_use=single_use)
+ server.initServer((host, int(port)), single_use=single_use,
+ idle_timeout=configParams.idle_timeout)
configuration.interface = [server.serverImpl.host, server.serverImpl.port]
else:
server.initServer(single_use=single_use)