Spaces:
Running
Running
sghorbal commited on
Commit ·
a8be403
1
Parent(s): 77c6297
use a pool of workers instead of a single one
Browse files- .env.example +2 -0
- entrypoint.sh +4 -4
.env.example
CHANGED
|
@@ -4,3 +4,5 @@ FLARESOLVERR_API=
|
|
| 4 |
|
| 5 |
# If set, protects the API from unauthorized called
|
| 6 |
FASTAPI_API_KEY=
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# If set, protects the API from unauthorized called
|
| 6 |
FASTAPI_API_KEY=
|
| 7 |
+
|
| 8 |
+
NB_RQ_WORKERS=1
|
entrypoint.sh
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Launch rqscheduler --url $REDIS_URL and rq
|
| 4 |
# if REDIS_URL is set and ENV is not test
|
| 5 |
if [[ -n "$REDIS_URL" && "$ENV" != "test" ]]; then
|
| 6 |
-
echo "Starting rq scheduler and
|
| 7 |
-
rq worker --url $REDIS_URL &
|
| 8 |
rqscheduler --url $REDIS_URL &
|
| 9 |
else
|
| 10 |
-
echo "Skipping rq scheduler and
|
| 11 |
fi
|
| 12 |
|
| 13 |
# Run the API
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Launch rqscheduler --url $REDIS_URL and rq workers in the background
|
| 4 |
# if REDIS_URL is set and ENV is not test
|
| 5 |
if [[ -n "$REDIS_URL" && "$ENV" != "test" ]]; then
|
| 6 |
+
echo "Starting rq scheduler and workers..."
|
| 7 |
+
rq worker-pool -n ${NB_RQ_WORKERS:-1} --url $REDIS_URL &
|
| 8 |
rqscheduler --url $REDIS_URL &
|
| 9 |
else
|
| 10 |
+
echo "Skipping rq scheduler and workers startup."
|
| 11 |
fi
|
| 12 |
|
| 13 |
# Run the API
|