]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: main: Handle BB_SERVER_TIMEOUT = -1 for no server timeout
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 8 Aug 2017 09:12:08 +0000 (02:12 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Aug 2017 08:24:56 +0000 (09:24 +0100)
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>
bitbake/lib/bb/main.py
bitbake/lib/bb/server/process.py

index eba4aefb54bce97331da7acad0e014999861e357..0418d52b8448054846f35f3aeda7021f76a72af2 100755 (executable)
@@ -259,8 +259,10 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
                           help="The name/address for the bitbake xmlrpc server to bind to.")
 
         parser.add_option("-T", "--idle-timeout", type=float, dest="server_timeout",
-                          default=os.environ.get("BB_SERVER_TIMEOUT", 0) or None,
-                          help="Set timeout to unload bitbake server due to inactivity")
+                          default=os.getenv("BB_SERVER_TIMEOUT"),
+                          help="Set timeout to unload bitbake server due to inactivity, "
+                                "set to -1 means no unload, "
+                                "default: Environment variable BB_SERVER_TIMEOUT.")
 
         parser.add_option("", "--no-setscene", action="store_true",
                           dest="nosetscene", default=False,
index 5b8a549f94ed54abd0807f9b63bb1add76fe6144..338c44835e15970aad349b4926fde6a4cd6bfc4c 100644 (file)
@@ -180,7 +180,8 @@ class ProcessServer(multiprocessing.Process):
                     if self.timeout is None:
                         print("No timeout, exiting.")
                         self.quit = True
-            if not self.haveui and self.lastui and self.timeout and (self.lastui + self.timeout) < time.time():
+            if not self.timeout == -1.0 and not self.haveui and self.lastui and self.timeout and \
+                    (self.lastui + self.timeout) < time.time():
                 print("Server timeout, exiting.")
                 self.quit = True