And the compose deploy now works

This commit is contained in:
2023-09-04 17:41:19 +01:00
parent f6431ee922
commit ce8a22203d
3 changed files with 44 additions and 46 deletions
+10 -3
View File
@@ -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]