[elbe-devel] [PATCH 04/22] elbepack: projectmanager: avoid cache indirection in set_project_xml()

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Aug 14 15:29:18 CEST 2024


The target project is already available, there is no need for the
indirection refetching it from the cache.
The busy check that was performed in _get_current_project() is already
part of db.set_xml().

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/daemons/soap/esoap.py | 2 +-
 elbepack/projectmanager.py     | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index d85f9f18125c..aac1c78db937 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -143,7 +143,7 @@ class ESoap (ServiceBase):
                 self.app.pm.close_current_project(uid)
                 self.app.pm.open_project(
                     uid, builddir, url_validation=ValidationMode.NO_CHECK)
-                self.app.pm.set_current_project_xml(uid, fn)
+                self.app.pm.set_project_xml(builddir, fn)
             return -2
 
         with open(fn, 'ab') as fp:
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index 2c2581e196d4..aa210697f156 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -159,11 +159,9 @@ class ProjectManager:
 
         self.db.del_project(builddir)
 
-    def set_current_project_xml(self, userid, xml_file):
+    def set_project_xml(self, builddir, xml_file):
         with self.lock:
-            ep = self._get_current_project(userid, allow_busy=False)
-
-            self.db.set_xml(ep.builddir, xml_file)
+            self.db.set_xml(builddir, xml_file)
 
     def set_current_project_upload_cdrom(self, userid):
         with self.lock:

-- 
2.46.0



More information about the elbe-devel mailing list