Repository navigation
Wire WORKER_ENABLED into docker-compose so schedules actually run - #151
Merged
Merged
Conversation
Schedule.nextRunAt/lastRunAt and the job worker's poll both no-op unless WORKER_ENABLED=true is set on the server process (JobWorkerService.isEnabled()) - it wasn't passed through in either compose file, so schedules (e.g. attendance-cleanup-sweep) never ran regardless of the schedules table row being correctly configured. - .env.template: default WORKER_ENABLED=true - docker-compose.yml / docker-compose-swarm.yml: pass it to the server service's environment Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s
There was a problem hiding this comment.
🟡 Changes recommended
Compose wiring still disables worker when env var missing (empty string), plus template comment needs scaled-deploy warning to prevent multi-replica schedule double-fire.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Wire WORKER_ENABLED env var into docker-compose server container so job worker poll + schedule heartbeat tick can run in Docker deployments, unblocking schedules.nextRunAt/lastRunAt updates.
Changes:
- Add
WORKER_ENABLED=trueto.env.template - Pass
WORKER_ENABLEDintoserverservice env fordocker-compose.yml - Pass
WORKER_ENABLEDintoserverservice env fordocker-compose-swarm.yml
File summaries
| File | Description |
|---|---|
| docker-compose.yml | Add WORKER_ENABLED to server container environment |
| docker-compose-swarm.yml | Add WORKER_ENABLED to server container environment (swarm stack) |
| .env.template | Document default WORKER_ENABLED=true for job worker + scheduler |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
buzz-code
pushed a commit
that referenced
this pull request
Aug 23, 2026
Addresses Copilot review comments on PR #151: '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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s
buzz-code
added a commit
that referenced
this pull request
Aug 23, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause of
schedules.nextRunAt/lastRunAtstayingnullforever and jobs never running:WORKER_ENABLED(checked byJobWorkerService.isEnabled(), gates both the schedule heartbeat tick and the job worker poll) was never passed through docker-compose to theserverservice — it only existed asprocess.env.WORKER_ENABLEDwith nothing setting it..env.template— addWORKER_ENABLED=true(documented, defaulted on for the common single-container deployment)docker-compose.yml/docker-compose-swarm.yml— passWORKER_ENABLEDthrough to theserverservice'senvironmentNote for whoever deploys this
The
.envfiles on actual running hosts (not tracked in git) needWORKER_ENABLED=trueadded and theservercontainer restarted for this to take effect — this PR only fixes the template/compose wiring.🤖 Generated with Claude Code
Generated by Claude Code