tennis-api / entrypoint.sh
sghorbal
use a pool of workers instead of a single one
a8be403
raw
history blame contribute delete
445 Bytes
#!/bin/bash
# Launch rqscheduler --url $REDIS_URL and rq workers in the background
# if REDIS_URL is set and ENV is not test
if [[ -n "$REDIS_URL" && "$ENV" != "test" ]]; then
echo "Starting rq scheduler and workers..."
rq worker-pool -n ${NB_RQ_WORKERS:-1} --url $REDIS_URL &
rqscheduler --url $REDIS_URL &
else
echo "Skipping rq scheduler and workers startup."
fi
# Run the API
uvicorn src.main:app --host 0.0.0.0 --port 7860