Commit ead2f98
committed
fix(webhook-engine,webapp): skip Redis and worker setup when the feature is disabled
The engine singleton is constructed at boot, opening the front-gate Redis client
and the worker's queue (a second Redis client plus queue-size gauges) regardless
of WEBHOOK_ENABLED. Only worker.start() was flag-gated, so a deployment with
webhooks off still held two Redis connections and polled queue size, and one
without the webhook Redis configured would spam reconnect errors.
Add an engine-level disabled option (set from WEBHOOK_ENABLED !== '1') that skips
building the Redis clients and the worker entirely. The public entry points
(ingest, simulateInject, replayDelivery, getJob) assert the engine is enabled and
quit() no-ops, so an off deployment is genuinely inert. worker.disabled is
unchanged: an ingress-only instance still builds the engine but does not start the
worker loop.1 parent c267f35 commit ead2f98
4 files changed
Lines changed: 65 additions & 3 deletions
File tree
- apps/webapp/app/v3
- internal-packages/webhook-engine/src/engine
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
| |||
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
137 | 143 | | |
138 | 144 | | |
139 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
140 | 152 | | |
141 | 153 | | |
| 154 | + | |
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| |||
317 | 330 | | |
318 | 331 | | |
319 | 332 | | |
| 333 | + | |
320 | 334 | | |
321 | 335 | | |
322 | 336 | | |
| |||
354 | 368 | | |
355 | 369 | | |
356 | 370 | | |
| 371 | + | |
357 | 372 | | |
358 | 373 | | |
359 | 374 | | |
| |||
748 | 763 | | |
749 | 764 | | |
750 | 765 | | |
| 766 | + | |
751 | 767 | | |
752 | 768 | | |
753 | 769 | | |
754 | 770 | | |
| 771 | + | |
755 | 772 | | |
756 | 773 | | |
757 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
0 commit comments