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

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Aug 14 15:29:23 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 28ac3ca59793..9cac449b2bc1 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -268,8 +268,7 @@ class ESoap (ServiceBase):
     @rpc(String, String, Boolean)
     @authenticated_uid
     def finish_pdebuild(self, uid, builddir, profile, cross):
-        self.app.pm.open_project(uid, builddir)
-        self.app.pm.build_current_pdebuild(uid, profile, cross)
+        self.app.pm.build_pdebuild(uid, builddir, profile, cross)
 
     @rpc(String, String)
     @authenticated_uid
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index f3a00f131b9c..23c8bb4e2cc8 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -198,9 +198,9 @@ class ProjectManager:
             self.worker.enqueue(CreatePbuilderJob(ep, ccachesize, cross,
                                                   noccache))
 
-    def build_current_pdebuild(self, userid, profile, cross):
+    def build_pdebuild(self, userid, builddir, profile, cross):
+        ep = self.open_project(userid, builddir, allow_busy=False)
         with self.lock:
-            ep = self._get_current_project(userid, allow_busy=False)
             if (not path.isdir(path.join(ep.builddir, 'pbuilder')) and
                     not path.isdir(path.join(ep.builddir, 'pbuilder_cross'))):
                 raise InvalidState('No pbuilder exists: run "elbe pbuilder '

-- 
2.46.0



More information about the elbe-devel mailing list