mirror of
https://github.com/block/buzz.git
synced 2026-11-04 00:12:02 +00:00
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:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user