From 837df29a841e9e1912655fb0b2020ac34cdc1763 Mon Sep 17 00:00:00 2001 From: Safwan Date: Sun, 6 Sep 2026 17:07:13 -0700 Subject: [PATCH] Document maintenance scope for clients sharing a schema Assisted-by: OpenAI Codex --- docs/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/README.md b/docs/README.md index 4f91542a..a0bdf16e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -85,6 +85,19 @@ if err := riverClient.Start(ctx); err != nil { `Workers` can also be omitted, but it's better to include it so River can check that inserted job kinds have a worker that can run them. +### Sharing a schema between clients + +By default, clients using the same River tables elect a single leader to run +maintenance services across all queues. `Queues` controls which queues a client +works, but does not limit the leader's maintenance scope. For example, the job +rescuer can discard a stuck job from another queue if its kind is not registered +in the leader's `Workers` bundle. + +Clients sharing a schema should register all job kinds that may need rescue, +even when they work different queues. For independent applications with separate +worker registries, use separate Postgres schemas and set `Config.Schema` on each +client. Migrate each schema before starting its clients. + ### Stopping The client should also be stopped on program shutdown. There's a number of ways