[oe-commits] [bitbake] 02/18: cookerdata/cooker: Restore original datastore upon client disconnect

git at git.openembedded.org git at git.openembedded.org
Wed Jul 19 09:43:16 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit f43b11914477394c484752e6f5a7f44e1b433b3c
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Jul 18 17:50:24 2017 +0100

    cookerdata/cooker: Restore original datastore upon client disconnect
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cooker.py     | 2 ++
 lib/bb/cookerdata.py | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index e27763e..daffe67 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1566,6 +1566,8 @@ class BBCooker:
     def clientComplete(self):
         """Called when the client is done using the server"""
         self.finishcommand()
+        self.databuilder.reset()
+        self.data = self.databuilder.data
 
 def server_main(cooker, func, *args):
     cooker.pre_serve()
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index d05abfe..b3a3f04 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -328,6 +328,13 @@ class CookerDataBuilder(object):
             logger.exception("Error parsing configuration files")
             raise bb.BBHandledException
 
+        # Create a copy so we can reset at a later date when UIs disconnect
+        self.origdata = self.data
+        self.data = bb.data.createCopy(self.origdata)
+
+    def reset(self):
+        self.data = bb.data.createCopy(self.origdata)
+
     def _findLayerConf(self, data):
         return findConfigFile("bblayers.conf", data)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list