Rename the db crate to database
This commit is contained in:
@@ -8,5 +8,5 @@ rust-version.workspace = true
|
||||
admin_backend = { path = "../admin_backend" }
|
||||
axum.workspace = true
|
||||
clusters.workspace = true
|
||||
db.workspace = true
|
||||
database.workspace = true
|
||||
tokio = { workspace = true, features = ["net", "signal", "sync", "time"] }
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::{env, error::Error, io, net::SocketAddr, sync::Arc};
|
||||
|
||||
use axum::Router;
|
||||
use clusters::{DOCUMENTS, DeploymentConfig, ResolvedDeployment};
|
||||
use db::{ConnectError, connect_resolved, connect_sql};
|
||||
use database::{ConnectError, connect_resolved, connect_sql};
|
||||
use tokio::{net::TcpListener, sync::watch};
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
Reference in New Issue
Block a user