[elbe-devel] [PATCH] elbepack: asyncworker: simplify run loop
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Mon Aug 19 11:30:47 CEST 2024
The flag variable is unnecessary.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/asyncworker.py | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
index 02208c37c90a..348367b0c038 100644
--- a/elbepack/asyncworker.py
+++ b/elbepack/asyncworker.py
@@ -304,13 +304,12 @@ class AsyncWorker(Thread):
job.enqueue(self.queue, self.db)
def run(self):
- loop = True
- while loop:
+ while True:
job = self.queue.get()
- if job is not None:
- with savecwd():
- with elbe_logging(projects=job.project.builddir):
- job.execute(self.db)
- else:
- loop = False
+ if job is None:
+ break
+
+ with savecwd():
+ with elbe_logging(projects=job.project.builddir):
+ job.execute(self.db)
self.queue.task_done()
---
base-commit: e769c034419472b9f0486e007184a20fa40e5566
change-id: 20240819-run_loop-60d98f957c2b
Best regards,
--
Thomas Weißschuh <thomas.weissschuh at linutronix.de>
More information about the elbe-devel
mailing list