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

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


The target project is already available, there is no need for the
indirection refetching it from the cache.

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

diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index e2e8723a3c23..dbd5fcf5964a 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -355,5 +355,4 @@ class ESoap (ServiceBase):
     @rpc(String, String)
     @authenticated_uid
     def include_package(self, uid, builddir, filename):
-        self.app.pm.open_project(uid, builddir)
-        self.app.pm.add_deb_package(uid, filename)
+        self.app.pm.add_deb_package(uid, builddir, filename)
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index 78176ca9bedc..269cdd82cab5 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -269,8 +269,8 @@ class ProjectManager:
         with open(os.path.join(ep.builddir, 'log.txt'), 'wb', 0):
             pass
 
-    def add_deb_package(self, userid, filename):
-        ep = self._get_current_project(userid)
+    def add_deb_package(self, userid, builddir, filename):
+        ep = self.open_project(userid, builddir)
 
         t = os.path.splitext(filename)[1]  # filetype of uploaded file
         pkg_name = filename.split('_')[0]

-- 
2.46.0



More information about the elbe-devel mailing list