fix(search): log only the error kind when a search cancel fails

Co-authored-by: Will Pfleger <wpfleger@block.xyz>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
This commit is contained in:
Will Pfleger
2026-11-02 20:06:16 -05:00
parent 8c1454cdd6
commit dc938323a2

View File

@@ -119,7 +119,7 @@ async fn cancel(pool: &PgPool, (pid, started_us): (i32, i64)) -> &'static str {
let mut conn = match tokio::time::timeout(CANCEL_ACQUIRE_TIMEOUT, pool.acquire()).await {
Ok(Ok(conn)) => conn,
Ok(Err(e)) => {
tracing::warn!(error = %e, pid, "search cancel could not get a connection");
tracing::warn!(error_kind = %buzz_db::error::sqlx_error_kind(&e), pid, "search cancel could not get a connection");
return "error";
}
Err(_) => return "pool_busy",
@@ -133,7 +133,7 @@ async fn cancel(pool: &PgPool, (pid, started_us): (i32, i64)) -> &'static str {
Ok(None) => elsewhere.push(conn),
Ok(Some(signalled)) => return signal_outcome(signalled),
Err(e) => {
tracing::warn!(error = %e, pid, "search cancel failed");
tracing::warn!(error_kind = %buzz_db::error::sqlx_error_kind(&e), pid, "search cancel failed");
return "error";
}
}