Files
leocrm/worker.sh
T

19 lines
754 B
Bash
Raw Permalink Normal View History

2026-07-25 21:03:46 +02:00
#!/bin/sh
# =============================================================================
# worker.sh — Container entrypoint for ARQ background worker
#
# Responsibilities:
# 1. Start the ARQ worker as PID 1 (so signals like SIGTERM are forwarded).
#
# Notes:
# - No migrations, no uvicorn — this container only processes background jobs.
# - The worker connects to the same Redis instance as the API container.
# - Cron jobs use a Redis-based distributed lock to prevent duplicate
# execution when multiple worker replicas are running.
# =============================================================================
set -e
echo "[worker] $(date -u +%Y-%m-%dT%H:%M:%SZ) - Starting ARQ worker..."
exec arq app.core.worker.WorkerSettings