perf: reduce gateway db pressure under load

This commit is contained in:
elky
2026-06-22 00:08:48 +08:00
parent 541cc197c4
commit f75894acbb
52 changed files with 4440 additions and 252 deletions
@@ -200,9 +200,13 @@ pub(super) async fn collect_selectable_enumerated_candidates_with_skip_reasons(
),
GatewayError,
> {
let runtime_snapshot =
read_candidate_runtime_selection_snapshot(runtime_state, &candidates, now_unix_secs)
.await?;
let runtime_snapshot = read_candidate_runtime_selection_snapshot(
runtime_state,
&candidates,
auth_snapshot,
now_unix_secs,
)
.await?;
let affinity_cache_key = build_scheduler_affinity_cache_key(
auth_snapshot,
api_format,