fix old log loading

This commit is contained in:
2026-08-11 02:41:18 +08:00
parent b62c74b883
commit d81d3675f8
3 changed files with 145 additions and 13 deletions
+8 -2
View File
@@ -82,8 +82,14 @@ async fn logs_response(
match state.history.page(before, limit).await {
Ok(page) => Json(page).into_response(),
Err(code) if code == "invalid_cursor" => error(StatusCode::BAD_REQUEST, "invalid_cursor"),
Err(code) if code == "stale_cursor" => error(StatusCode::CONFLICT, "stale_cursor"),
Err(_) => error(StatusCode::UNPROCESSABLE_ENTITY, "history_unavailable"),
Err(code) if code == "stale_cursor" => {
tracing::debug!(event = "history_page_failed", reason = "stale_cursor");
error(StatusCode::CONFLICT, "stale_cursor")
}
Err(code) => {
tracing::warn!(event = "history_page_failed", reason = %code);
error(StatusCode::UNPROCESSABLE_ENTITY, "history_unavailable")
}
}
}