Fix RQ worker invocation

This commit is contained in:
2026-07-28 00:01:31 +03:30
parent 983b5279a2
commit 3f180e88ed
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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
View File
@@ -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: