Rename the db crate to database

This commit is contained in:
2026-11-30 20:23:47 +08:00
parent af9f25baa5
commit f0470c406b
16 changed files with 15 additions and 13 deletions
+2 -2
View File
@@ -2,14 +2,14 @@ use std::{sync::Arc, time::Duration};
use axum::{Router, extract::State, http::StatusCode, routing::get};
pub fn router(db: db::Connection) -> Router {
pub fn router(db: database::Connection) -> Router {
Router::new()
.route("/healthz", get(|| async { StatusCode::NO_CONTENT }))
.route("/readyz", get(readiness))
.with_state(Arc::new(db))
}
async fn readiness(State(db): State<Arc<db::Connection>>) -> StatusCode {
async fn readiness(State(db): State<Arc<database::Connection>>) -> StatusCode {
match tokio::time::timeout(Duration::from_secs(2), db.revision()).await {
Ok(Ok(_)) => StatusCode::NO_CONTENT,
_ => StatusCode::SERVICE_UNAVAILABLE,