fix(usage): 为 InMemory 仓库补充 status 过滤逻辑

This commit is contained in:
fawney19
2026-04-15 09:53:52 +08:00
parent 8827c46c33
commit 4087e096f2
2 changed files with 6 additions and 4 deletions

View File

@@ -71,10 +71,7 @@ pub(super) async fn maybe_build_local_admin_usage_summary_response(
UsageAuditListQuery::default() UsageAuditListQuery::default()
} else { } else {
UsageAuditListQuery { UsageAuditListQuery {
statuses: Some(vec![ statuses: Some(vec!["pending".to_string(), "streaming".to_string()]),
"pending".to_string(),
"streaming".to_string(),
]),
..Default::default() ..Default::default()
} }
}; };

View File

@@ -200,6 +200,11 @@ impl UsageReadRepository for InMemoryUsageReadRepository {
return false; return false;
} }
} }
if let Some(statuses) = query.statuses.as_ref() {
if !statuses.iter().any(|s| s == &item.status) {
return false;
}
}
true true
}) })
.cloned() .cloned()