Fix RQ worker invocation
This commit is contained in:
+2
-1
@@ -30,8 +30,9 @@ def on_startup() -> None:
|
|||||||
if os.environ.get("SKIP_INTERNAL_WORKER", "").lower() in ("1", "true", "yes"):
|
if os.environ.get("SKIP_INTERNAL_WORKER", "").lower() in ("1", "true", "yes"):
|
||||||
return
|
return
|
||||||
redis_url = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
|
redis_url = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
|
||||||
|
rq_executable = str(Path(sys.executable).with_name("rq"))
|
||||||
_rq_worker = subprocess.Popen(
|
_rq_worker = subprocess.Popen(
|
||||||
[sys.executable, "-m", "rq", "worker", "--url", redis_url, "batch"],
|
[rq_executable, "worker", "--url", redis_url, "batch"],
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ services:
|
|||||||
image: seed:latest
|
image: seed:latest
|
||||||
container_name: seed-worker
|
container_name: seed-worker
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
command: python -m rq worker --url redis://redis:6379/0 batch
|
command: ["rq", "worker", "--url", "redis://redis:6379/0", "batch"]
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user