And the compose deploy now works
This commit is contained in:
+10
-3
@@ -5,19 +5,26 @@ use axum::{Extension, Router};
|
||||
use std::net::SocketAddr;
|
||||
use axum::routing::{get, post};
|
||||
use clap::Parser;
|
||||
use sea_orm::{ConnectionTrait, DatabaseConnection};
|
||||
use migration::{Migrator, MigratorTrait};
|
||||
use crate::error::AppError;
|
||||
use crate::ingestion::ingestion::{monzo_batched_csv, monzo_batched_json, monzo_updated};
|
||||
|
||||
#[derive(Debug, clap::Parser)]
|
||||
struct Config {
|
||||
#[clap(short, long, env)]
|
||||
#[clap(short, long, env, default_value = "0.0.0.0:3000")]
|
||||
addr: SocketAddr,
|
||||
#[clap(short, long = "db", env)]
|
||||
database_url: String,
|
||||
}
|
||||
|
||||
async fn health_check() -> &'static str {
|
||||
"Ok"
|
||||
async fn health_check(
|
||||
Extension(db): Extension<DatabaseConnection>,
|
||||
) -> Result<&'static str, AppError> {
|
||||
db.execute_unprepared("SELECT 1")
|
||||
.await?;
|
||||
|
||||
Ok("Ok")
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
Reference in New Issue
Block a user