Commit 1699582
committed
feat(webapp): debounce LLM pricing registry reloads
Coalesce reload calls from the pub/sub subscriber so a burst of
publishes only triggers one reload. The first publish in a window
schedules a reload at T+LLM_PRICING_RELOAD_DEBOUNCE_MS (default 1s);
subsequent publishes during that window are no-ops because the
trailing reload will pick up everything when it queries the DB.
Bounds reload rate to at most 1 per debounce window regardless of
publisher chattiness, so a runaway upstream publisher can't fan out
into a flood of full-table-scan reloads across every webapp pod.1 parent e768e53 commit 1699582
2 files changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
| 1428 | + | |
1428 | 1429 | | |
1429 | 1430 | | |
1430 | 1431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
61 | 82 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| 88 | + | |
71 | 89 | | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| 93 | + | |
75 | 94 | | |
76 | 95 | | |
77 | 96 | | |
| |||
0 commit comments