fix: allow river to use polling only#400
Conversation
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds a ChangesWorker polling mode configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds a worker configuration option to run River in polling-only mode (disabling PostgreSQL LISTEN/NOTIFY), allowing deployments that can’t rely on notifications to still process jobs reliably.
Changes:
- Add
UsePollingtoWorkerConfig, defaulting tofalse, and wire it fromCCF_WORKER_USE_POLLINGvia viper. - Pass
UsePollingthrough to River viariver.Config{ PollOnly: ... }and log the effective setting at startup. - Add unit tests covering the default and enabled behavior for the new config flag.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/service/worker/service.go | Plumbs UsePolling into River config (PollOnly) and logs the setting on startup. |
| internal/service/worker/service_test.go | Adds tests validating PollOnly default/override behavior in buildRiverConfig. |
| internal/config/worker.go | Introduces UsePolling in WorkerConfig and sets default to false. |
| internal/config/worker_test.go | Adds a test confirming UsePolling is disabled by default. |
| internal/config/config.go | Reads worker_use_polling from viper into WorkerConfig.UsePolling. |
| cmd/root.go | Binds the worker_use_polling environment variable for viper (CCF_WORKER_USE_POLLING). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Release Notes
New Features
CCF_WORKER_USE_POLLINGenvironment variable to enable polling-based worker behavior. Defaults to disabled, preserving existing PostgreSQL LISTEN/NOTIFY functionality.Tests