From a95b73575bbb54f6515e28c1a26f530b54cf0749 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 23 Aug 2026 19:42:40 +0000 Subject: [PATCH] Default WORKER_ENABLED to true when unset in compose env Follow-up to #151, which merged before these Copilot review comments were addressed: 'WORKER_ENABLED: $WORKER_ENABLED' substitutes an empty string (not the .env.template-documented default of true) when the var is missing from the actual deployed .env - silently disabling the worker/heartbeat. Use Compose's default interpolation instead, and clarify in .env.template that this must stay true on only one instance in a scaled deployment. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s --- .env.template | 5 ++++- docker-compose-swarm.yml | 2 +- docker-compose.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.template b/.env.template index 15bc0dd0..f9930414 100644 --- a/.env.template +++ b/.env.template @@ -14,5 +14,8 @@ MAINTENANCE_MODE=false MAINTENANCE_MESSAGE=המערכת בתחזוקה תכנונית. אנא נסו שוב מאוחר יותר. # Enables the background job worker + schedule heartbeat (recurring jobs like -# attendance-cleanup-sweep) on this server instance. +# attendance-cleanup-sweep) on this server instance. Defaults to true for the +# common single-container deployment. If ever running multiple server +# replicas, keep this true on only one of them (or a dedicated worker +# instance) - the heartbeat isn't safe to double-fire. WORKER_ENABLED=true diff --git a/docker-compose-swarm.yml b/docker-compose-swarm.yml index e57f02e9..f59c6e2e 100644 --- a/docker-compose-swarm.yml +++ b/docker-compose-swarm.yml @@ -96,7 +96,7 @@ services: SMTP_PASSWORD: $SMTP_PASSWORD MAINTENANCE_MODE: $MAINTENANCE_MODE MAINTENANCE_MESSAGE: $MAINTENANCE_MESSAGE - WORKER_ENABLED: $WORKER_ENABLED + WORKER_ENABLED: ${WORKER_ENABLED:-true} # ports: # - '30004:3000' networks: diff --git a/docker-compose.yml b/docker-compose.yml index 12ab48d2..0ea51f2a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,7 +63,7 @@ services: SMTP_PASSWORD: $SMTP_PASSWORD MAINTENANCE_MODE: $MAINTENANCE_MODE MAINTENANCE_MESSAGE: $MAINTENANCE_MESSAGE - WORKER_ENABLED: $WORKER_ENABLED + WORKER_ENABLED: ${WORKER_ENABLED:-true} depends_on: - database labels: