Commit 8455b57
committed
fix(webapp): build the idempotency shard-client map on first use
Building it at module scope dereferenced the db.server run-ops handles at
import time. This module is imported by triggerTask, so any test that
mocks `~/db.server` without those two exports failed to collect —
runEngineBatchTriggerStoreRouting and routesBatchGetReplicaLag both did.
Before this change those handles were only read inside the two methods
that use them. Restore that: resolve the map on first use and memoise it,
since the trigger path is the hottest in the system.
No test behaviour changes; this is the inert-by-default property the
change was supposed to have in the first place.1 parent b32aafa commit 8455b57
1 file changed
Lines changed: 17 additions & 12 deletions
Lines changed: 17 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
186 | 191 | | |
187 | 192 | | |
188 | 193 | | |
189 | | - | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
656 | 661 | | |
657 | 662 | | |
658 | 663 | | |
659 | | - | |
| 664 | + | |
660 | 665 | | |
661 | 666 | | |
662 | 667 | | |
| |||
0 commit comments