Update BossAI workflow and workspace experience

This commit is contained in:
boos
2026-05-28 10:32:20 +08:00
parent e0bd9b4194
commit 931bcf3fb9
39 changed files with 7791 additions and 1328 deletions
+10 -1
View File
@@ -21,8 +21,17 @@ pub async fn enforce_key_request_limit(
return Err(AppError::Forbidden("API key is disabled".into()));
}
if let Some(max_requests) = max_requests {
if max_requests <= 0 {
return Err(AppError::RateLimitedWithRetry {
message: "下游密钥请求额度已用完".into(),
retry_after_secs: 60,
});
}
if used_requests.unwrap_or(0) + increment > max_requests {
return Err(AppError::RateLimited);
return Err(AppError::RateLimitedWithRetry {
message: "下游密钥请求额度已用完".into(),
retry_after_secs: 60,
});
}
}
Ok(())