Hi,
I updated today to the latest version of litestar-saq and SAQ and I noticed an issue in the code here https://github.com/cofin/litestar-saq/blame/main/litestar_saq/cli.py#L85-L100.
Currently, when running SAQ as a separate instance form main Litestar (i.e. litestar workers run), when looping over managed_workers skips the last Queue/worker.
If I understand correctly, the loop is triggering one less worker since the first worker is manually triggered after the loop. Therefore, the loop should be written as follows:
if len(managed_workers) > 1:
for j in range(len(managed_workers) - 1):
p = multiprocessing.Process(target=run_saq_worker, args=(managed_workers[j + 1], app.logging_config))
p.start()
_processes.append(p)
Since managed_workers[0] is manually triggered later:
run_saq_worker(
worker=managed_workers[0],
logging_config=cast("BaseLoggingConfig", app.logging_config),
)
Best wishes,
Panagiotis
Hi,
I updated today to the latest version of litestar-saq and SAQ and I noticed an issue in the code here https://github.com/cofin/litestar-saq/blame/main/litestar_saq/cli.py#L85-L100.
Currently, when running SAQ as a separate instance form main Litestar (i.e.
litestar workers run), when looping overmanaged_workersskips the last Queue/worker.If I understand correctly, the loop is triggering one less worker since the first worker is manually triggered after the loop. Therefore, the loop should be written as follows:
Since
managed_workers[0]is manually triggered later:Best wishes,
Panagiotis