Commit 2707058
committed
perf(rpc): fire-and-forget cache writes in links router
Link create / update / delete were awaiting cache work — setCachedLink,
invalidateLinkCache, invalidateAgentContextSnapshotsForOwner — on the
response path. The agent-context invalidation is a Redis SCAN + per-key
Lua-CAS that can fan out to hundreds of ops for active orgs, adding
seconds before the response returns. /links/create p50 was 13.5s in
prod for the busiest API-key caller; this is one of the contributors.
Detach the cache calls and log failures via .catch. The pre-delete
invalidateLinkCache stays awaited because it is load-bearing for cache
consistency (must clear before the row disappears).1 parent 7c56dd1 commit 2707058
1 file changed
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
| 392 | + | |
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
399 | 405 | | |
400 | 406 | | |
401 | 407 | | |
| |||
511 | 517 | | |
512 | 518 | | |
513 | 519 | | |
514 | | - | |
| 520 | + | |
515 | 521 | | |
516 | 522 | | |
517 | 523 | | |
| |||
585 | 591 | | |
586 | 592 | | |
587 | 593 | | |
588 | | - | |
589 | 594 | | |
590 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
591 | 602 | | |
592 | 603 | | |
593 | 604 | | |
| |||
0 commit comments