Skip to content

Commit e61595e

Browse files
buzz-codeclaude
andauthored
Default WORKER_ENABLED to true when unset in compose env (#156)
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. Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8bb2194 commit e61595e

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎.env.template‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ MAINTENANCE_MODE=false
1414
MAINTENANCE_MESSAGE=המערכת בתחזוקה תכנונית. אנא נסו שוב מאוחר יותר.
1515

1616
# Enables the background job worker + schedule heartbeat (recurring jobs like
17-
# attendance-cleanup-sweep) on this server instance.
17+
# attendance-cleanup-sweep) on this server instance. Defaults to true for the
18+
# common single-container deployment. If ever running multiple server
19+
# replicas, keep this true on only one of them (or a dedicated worker
20+
# instance) - the heartbeat isn't safe to double-fire.
1821
WORKER_ENABLED=true

‎docker-compose-swarm.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ services:
9696
SMTP_PASSWORD: $SMTP_PASSWORD
9797
MAINTENANCE_MODE: $MAINTENANCE_MODE
9898
MAINTENANCE_MESSAGE: $MAINTENANCE_MESSAGE
99-
WORKER_ENABLED: $WORKER_ENABLED
99+
WORKER_ENABLED: ${WORKER_ENABLED:-true}
100100
# ports:
101101
# - '30004:3000'
102102
networks:

‎docker-compose.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ services:
6363
SMTP_PASSWORD: $SMTP_PASSWORD
6464
MAINTENANCE_MODE: $MAINTENANCE_MODE
6565
MAINTENANCE_MESSAGE: $MAINTENANCE_MESSAGE
66-
WORKER_ENABLED: $WORKER_ENABLED
66+
WORKER_ENABLED: ${WORKER_ENABLED:-true}
6767
depends_on:
6868
- database
6969
labels:

0 commit comments

Comments
 (0)