Skip to content

Commit 82fa9b9

Browse files
committed
fix: apply ruff formatter to health.py
Fix line-length violations in _check_database and _check_redis error return statements to comply with ruff formatter requirements.
1 parent d94eabd commit 82fa9b9

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

backend/app/api/health.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,19 @@ async def _check_database() -> dict:
4747
except SQLAlchemyError as exc:
4848
latency_ms = round((time.monotonic() - start) * 1000)
4949
logger.warning("Health check DB failure: %s", exc)
50-
return {"status": "unavailable", "latency_ms": latency_ms, "error": "connection_error"}
50+
return {
51+
"status": "unavailable",
52+
"latency_ms": latency_ms,
53+
"error": "connection_error",
54+
}
5155
except Exception as exc:
5256
latency_ms = round((time.monotonic() - start) * 1000)
5357
logger.warning("Health check DB failure: %s", exc)
54-
return {"status": "unavailable", "latency_ms": latency_ms, "error": "unexpected_error"}
58+
return {
59+
"status": "unavailable",
60+
"latency_ms": latency_ms,
61+
"error": "unexpected_error",
62+
}
5563

5664

5765
async def _check_redis() -> dict:
@@ -67,11 +75,19 @@ async def _check_redis() -> dict:
6775
except RedisError as exc:
6876
latency_ms = round((time.monotonic() - start) * 1000)
6977
logger.warning("Health check Redis failure: %s", exc)
70-
return {"status": "unavailable", "latency_ms": latency_ms, "error": "connection_error"}
78+
return {
79+
"status": "unavailable",
80+
"latency_ms": latency_ms,
81+
"error": "connection_error",
82+
}
7183
except Exception as exc:
7284
latency_ms = round((time.monotonic() - start) * 1000)
7385
logger.warning("Health check Redis failure: %s", exc)
74-
return {"status": "unavailable", "latency_ms": latency_ms, "error": "unexpected_error"}
86+
return {
87+
"status": "unavailable",
88+
"latency_ms": latency_ms,
89+
"error": "unexpected_error",
90+
}
7591

7692

7793
async def _check_solana_rpc() -> dict:

0 commit comments

Comments
 (0)