Add worker.pys

This commit is contained in:
Lucas Armand
2025-11-25 13:33:12 -08:00
parent 0339b471c5
commit 2ce0450809
5 changed files with 256 additions and 3 deletions
+13 -2
View File
@@ -133,8 +133,19 @@ cd "$SERVER_DIR"
echo "launching PyWorker server"
set +e
python3 -m "workers.$BACKEND.server" |& tee -a "$PYWORKER_LOG"
# Try worker entrypoint first
echo "trying workers.${BACKEND}.worker"
python3 -m "workers.${BACKEND}.worker" |& tee -a "$PYWORKER_LOG"
PY_STATUS=${PIPESTATUS[0]}
# If that fails, fall back to server
if [ "${PY_STATUS}" -ne 0 ]; then
echo "workers.${BACKEND}.worker failed with status ${PY_STATUS}, trying workers.${BACKEND}.server"
python3 -m "workers.${BACKEND}.server" |& tee -a "$PYWORKER_LOG"
PY_STATUS=${PIPESTATUS[0]}
fi
set -e
if [ "${PY_STATUS}" -ne 0 ]; then
@@ -171,4 +182,4 @@ JSON
done
fi
echo "launching PyWorker server done"
echo "launching PyWorker server done"