diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-07-19 23:20:34 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-21 07:48:52 +0100 |
commit | 317708235bfe876e127fde4b07c4f53d908c835f (patch) | |
tree | 42ced6b478320d861aa8054277611305461c7202 /bitbake/lib/bb/main.py | |
parent | 4cba010529b558bfbcf546942197277f8ce1b63e (diff) | |
download | poky-317708235bfe876e127fde4b07c4f53d908c835f.tar.gz |
bitbake: 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]
(Bitbake rev: 5fa0b3a19e7d0f40790f737abeddf499d53f1f6a)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-x | bitbake/lib/bb/main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 849cade8ca..7f7d87bd02 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -253,6 +253,10 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
253 | parser.add_option("-B", "--bind", action="store", dest="bind", default=False, | 253 | parser.add_option("-B", "--bind", action="store", dest="bind", default=False, |
254 | help="The name/address for the bitbake server to bind to.") | 254 | help="The name/address for the bitbake server to bind to.") |
255 | 255 | ||
256 | parser.add_option("-T", "--idle-timeout", type=int, | ||
257 | default=int(os.environ.get("BBTIMEOUT", "0")), | ||
258 | help="Set timeout to unload bitbake server due to inactivity") | ||
259 | |||
256 | parser.add_option("", "--no-setscene", action="store_true", | 260 | parser.add_option("", "--no-setscene", action="store_true", |
257 | dest="nosetscene", default=False, | 261 | dest="nosetscene", default=False, |
258 | help="Do not run any setscene tasks. sstate will be ignored and " | 262 | help="Do not run any setscene tasks. sstate will be ignored and " |
@@ -337,7 +341,8 @@ def start_server(servermodule, configParams, configuration, features): | |||
337 | single_use = not configParams.server_only and os.getenv('BBSERVER') != 'autostart' | 341 | single_use = not configParams.server_only and os.getenv('BBSERVER') != 'autostart' |
338 | if configParams.bind: | 342 | if configParams.bind: |
339 | (host, port) = configParams.bind.split(':') | 343 | (host, port) = configParams.bind.split(':') |
340 | server.initServer((host, int(port)), single_use=single_use) | 344 | server.initServer((host, int(port)), single_use=single_use, |
345 | idle_timeout=configParams.idle_timeout) | ||
341 | configuration.interface = [server.serverImpl.host, server.serverImpl.port] | 346 | configuration.interface = [server.serverImpl.host, server.serverImpl.port] |
342 | else: | 347 | else: |
343 | server.initServer(single_use=single_use) | 348 | server.initServer(single_use=single_use) |