solid_queue-listen_notify 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8a439406bd1b7fa1cc8433b7397f24806657ac4930bac1470ffec2265a8ac60
4
- data.tar.gz: e9e9fdebf590d423e528fc70d38cba87c6acf4e4e6b21f1b91725d1b7d7f3697
3
+ metadata.gz: 02e14b868585c5b513fd8c1e16222d75af15f95fb1a8775171505c4825b971a9
4
+ data.tar.gz: 16868e921aff4dd98118f4617da5b3007b6ad346e001231d34a8cb00f611d2de
5
5
  SHA512:
6
- metadata.gz: f1b86d7da131403275b52571cf975f76987cf8f912ac685d5848717b681a8823ed0668954b44022befb82ed9c4d304ae2e2fa9e5a6d7385d031db84b3a0a5c04
7
- data.tar.gz: 1c69cb4d0691584d1765312e9f835bb9ce9761b218b0172973bf969d0f2bf6299a775eac3be3056c45b84a4d77be080f4e215a8c548acd04423734b4418f5620
6
+ metadata.gz: df252638c88f888e052bde5e4ac262b28cc83830a095e445a24937d816758122a8373ca474c3ae28541b0c152864034b0eeee32b09525089b9d6da99b46ef221
7
+ data.tar.gz: 468f5eed99503c2690e37f107d16afed17ef2c5df279f8f411d2d2e987d5363fe80467b81beb867e7d5304f49ae51d97de0348e7533c667a65ba3e9f37c03dfd
data/CHANGELOG.md CHANGED
@@ -7,12 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.1] - 2026-07-28
11
+
12
+ ### Fixed
13
+
14
+ - `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED=false` now disables the gem even when the application sets `enabled` explicitly. It previously only seeded the default, so an app configuring `enabled` at all silently lost the environment kill switch.
15
+
10
16
  ## [0.5.0] - 2026-07-27
11
17
 
12
18
  ### First official release
13
19
 
14
20
 
15
21
 
16
- [Unreleased]: https://github.com/cmer/solid_queue-listen_notify/compare/v0.5.0...HEAD
22
+ [Unreleased]: https://github.com/cmer/solid_queue-listen_notify/compare/v0.5.1...HEAD
23
+ [0.5.1]: https://github.com/cmer/solid_queue-listen_notify/compare/v0.5.0...v0.5.1
17
24
  [0.5.0]: https://github.com/cmer/solid_queue-listen_notify/compare/v0.1.0...v0.5.0
18
25
  [0.1.0]: https://github.com/cmer/solid_queue-listen_notify/releases/tag/v0.1.0
data/README.md CHANGED
@@ -46,7 +46,7 @@ The defaults are right for most apps. The options you're most likely to touch:
46
46
  |---|---|---|
47
47
  | `fallback_polling_interval` | `10.seconds` | What workers' `polling_interval` is raised to once notifications are verified. Only ever raises; `nil` to leave intervals alone. |
48
48
  | `listen_database` | `nil` | A `database.yml` entry that connects **directly** to Postgres, for apps behind PgBouncer in transaction mode (which silently breaks `LISTEN` — the gem detects this at boot and tells you). |
49
- | `enabled` | `true` | Kill switch; also `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED=false` in the environment, no deploy needed. |
49
+ | `enabled` | `true` | Kill switch; also `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED=false` in the environment, no deploy needed — that one wins over whatever is configured here. |
50
50
 
51
51
  Set them in an initializer as above, or via `config.solid_queue_listen_notify.*` in your Rails config. The full list of options, log output, instrumentation events, and the complete failure-mode reference live in [docs/REFERENCE.md](docs/REFERENCE.md).
52
52
 
data/docs/REFERENCE.md CHANGED
@@ -63,7 +63,7 @@ The two are equivalent — `config.solid_queue_listen_notify` is copied onto the
63
63
 
64
64
  | Option | Default | What it does |
65
65
  |---|---|---|
66
- | `enabled` | `true`, unless `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED` is set to the literal string `"false"` | Master switch. When off, the preflight returns immediately with reason `:disabled`, nothing is registered, no connection is opened, and polling intervals are untouched. The environment variable is read once, when the gem is loaded, and **only the exact value `"false"` disables it** — `"0"`, `"no"` and `"off"` all leave the gem enabled. |
66
+ | `enabled` | `true`, unless `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED` is set to the literal string `"false"` | Master switch. When off, the preflight returns immediately with reason `:disabled`, nothing is registered, no connection is opened, and polling intervals are untouched. **Only the exact value `"false"` disables it** — `"0"`, `"no"` and `"off"` all leave the gem enabled. The environment variable is a one-way switch that beats configuration: it seeds this option's default, and it is also re-read on every check, so `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED=false` disables the gem even in an app that sets `enabled = true` explicitly. It can never do the reverse — nothing in the environment will enable the gem against an `enabled = false` you configured. |
67
67
  | `channel` | `"solid_queue_ready"` | The `pg_notify` channel. Must be **1 to 63 bytes** — Postgres's identifier limit — and must match what the installed trigger notifies on. The preflight checks the length before it opens a connection, and looks in the trigger's function body for the exact `pg_notify('<channel>', NEW.queue_name)` call to detect drift. |
68
68
  | `fallback_polling_interval` | `10.seconds` | The polling interval workers are raised to once notifications are proven to work. **Only ever raises**: a worker already configured to poll every 30 seconds keeps its 30 seconds, and a worker at 0.1 goes to 10. Set to `nil` to never touch any worker's interval. Applied only when the gem is operational, and put back if registration then fails. |
69
69
  | `listen_database` | `nil` | Name of a `config/database.yml` entry to open the listener connection against, instead of Solid Queue's own pool. This is the PgBouncer escape hatch: point it at an entry that connects **directly** to Postgres. It must name **the same database** as the queue database — only the connection route may differ — and the preflight's self-test fails if it doesn't. It gets a private connection handler, so it never mixes with your application's pools. |
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SolidQueue
4
4
  module ListenNotify
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.1"
6
6
  end
7
7
  end
@@ -23,6 +23,10 @@ module SolidQueue
23
23
  # files, is spelled `::Process` for that reason.
24
24
  extend self
25
25
 
26
+ # Seeds the default for applications that never set `enabled` themselves.
27
+ # An application that does set it wins here — but not in `enabled?`, which
28
+ # re-reads the variable so that it works as an emergency kill switch either
29
+ # way. See the comment there.
26
30
  mattr_accessor :enabled, default: ENV.fetch("SOLID_QUEUE_LISTEN_NOTIFY_ENABLED", "true") != "false"
27
31
 
28
32
  mattr_accessor :channel, default: "solid_queue_ready"
@@ -62,7 +66,15 @@ module SolidQueue
62
66
  @@overrides_lock = Mutex.new
63
67
  @@overrides = {}.compare_by_identity
64
68
 
69
+ # `SOLID_QUEUE_LISTEN_NOTIFY_ENABLED=false` is documented as a kill switch
70
+ # that needs no deploy, and an application that sets `enabled` explicitly —
71
+ # to either value — would otherwise overwrite the mattr default and take
72
+ # that switch away. So it is checked here too, and it only ever turns the
73
+ # gem OFF: the variable can never enable the gem against a configuration
74
+ # that disabled it.
65
75
  def enabled?
76
+ return false if ENV["SOLID_QUEUE_LISTEN_NOTIFY_ENABLED"] == "false"
77
+
66
78
  enabled
67
79
  end
68
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_queue-listen_notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Mercier