diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2017-08-08 02:12:08 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-09 09:24:56 +0100 |
| commit | 803b97a32effce3f0d1be11989406c7b63b86ac3 (patch) | |
| tree | 86a8c5300eeaf8c5a64ecfaaa930093660dfc0ce /bitbake/lib | |
| parent | 11bde5de8343f5b37c65c10a71824cdd57b85f86 (diff) | |
| download | poky-803b97a32effce3f0d1be11989406c7b63b86ac3.tar.gz | |
bitbake: main: Handle BB_SERVER_TIMEOUT = -1 for no server timeout
Make BB_SERVER_TIMEOUT = -1 mean no unload forever.
(Bitbake rev: 923d5567be6fd9969ca74c166f36817ec09305e3)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rwxr-xr-x | bitbake/lib/bb/main.py | 6 | ||||
| -rw-r--r-- | bitbake/lib/bb/server/process.py | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index eba4aefb54..0418d52b84 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
| @@ -259,8 +259,10 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
| 259 | help="The name/address for the bitbake xmlrpc server to bind to.") | 259 | help="The name/address for the bitbake xmlrpc server to bind to.") |
| 260 | 260 | ||
| 261 | parser.add_option("-T", "--idle-timeout", type=float, dest="server_timeout", | 261 | parser.add_option("-T", "--idle-timeout", type=float, dest="server_timeout", |
| 262 | default=os.environ.get("BB_SERVER_TIMEOUT", 0) or None, | 262 | default=os.getenv("BB_SERVER_TIMEOUT"), |
| 263 | help="Set timeout to unload bitbake server due to inactivity") | 263 | help="Set timeout to unload bitbake server due to inactivity, " |
| 264 | "set to -1 means no unload, " | ||
| 265 | "default: Environment variable BB_SERVER_TIMEOUT.") | ||
| 264 | 266 | ||
| 265 | parser.add_option("", "--no-setscene", action="store_true", | 267 | parser.add_option("", "--no-setscene", action="store_true", |
| 266 | dest="nosetscene", default=False, | 268 | dest="nosetscene", default=False, |
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index 5b8a549f94..338c44835e 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
| @@ -180,7 +180,8 @@ class ProcessServer(multiprocessing.Process): | |||
| 180 | if self.timeout is None: | 180 | if self.timeout is None: |
| 181 | print("No timeout, exiting.") | 181 | print("No timeout, exiting.") |
| 182 | self.quit = True | 182 | self.quit = True |
| 183 | if not self.haveui and self.lastui and self.timeout and (self.lastui + self.timeout) < time.time(): | 183 | if not self.timeout == -1.0 and not self.haveui and self.lastui and self.timeout and \ |
| 184 | (self.lastui + self.timeout) < time.time(): | ||
| 184 | print("Server timeout, exiting.") | 185 | print("Server timeout, exiting.") |
| 185 | self.quit = True | 186 | self.quit = True |
| 186 | 187 | ||
