sghorbal commited on
Commit
650da2e
·
1 Parent(s): e996349

start rq scheeduler and worker if it makes sense

Browse files
Files changed (1) hide show
  1. entrypoint.sh +10 -0
entrypoint.sh CHANGED
@@ -1,4 +1,14 @@
1
  #!/bin/bash
2
 
 
 
 
 
 
 
 
 
 
 
3
  # Run the API
4
  uvicorn src.main:app --host 0.0.0.0 --port 7860
 
1
  #!/bin/bash
2
 
3
+ # Launch rqscheduler --url $REDIS_URL and rq worker 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 worker..."
7
+ rq worker --url $REDIS_URL &
8
+ rqscheduler --url $REDIS_URL &
9
+ else
10
+ echo "Skipping rq scheduler and worker startup."
11
+ fi
12
+
13
  # Run the API
14
  uvicorn src.main:app --host 0.0.0.0 --port 7860