mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
fix(usage): 为 InMemory 仓库补充 status 过滤逻辑
This commit is contained in:
@@ -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()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user