From 9d2529867f0d7268df19233d3810e8745d9f74c5 Mon Sep 17 00:00:00 2001 From: Doron <4199618+doron1@users.noreply.github.com> Date: Tue, 19 May 2026 12:02:21 +0300 Subject: [PATCH] feat: add app_factory for uvicorn multi-worker support --- shelly-manager/rootfs/etc/services.d/api/run | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shelly-manager/rootfs/etc/services.d/api/run b/shelly-manager/rootfs/etc/services.d/api/run index 0b15c35..93458e2 100755 --- a/shelly-manager/rootfs/etc/services.d/api/run +++ b/shelly-manager/rootfs/etc/services.d/api/run @@ -10,7 +10,10 @@ LOG_LEVEL="${LOG_LEVEL:-info}" API_PORT="${API_PORT:-8000}" -exec s6-setuidgid abc /app/.venv/bin/uvicorn api.main:app \ +WORKERS="${API_WORKERS:-4}" +exec s6-setuidgid abc /app/.venv/bin/uvicorn api.main:app_factory \ + --factory \ --host 0.0.0.0 \ --port "${API_PORT}" \ - --log-level "${LOG_LEVEL}" + --log-level "${LOG_LEVEL}" \ + --workers "${WORKERS}"