This commit is contained in:
2024-05-28 15:48:55 +01:00
parent 89fccc8d85
commit 660b7b8676
7 changed files with 63 additions and 80 deletions
+8 -9
View File
@@ -1,14 +1,14 @@
mod ingestion;
mod error;
mod ingestion;
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::routes::{monzo_batched_csv, monzo_batched_json, monzo_updated};
use axum::routing::{get, post};
use axum::{Extension, Router};
use clap::Parser;
use migration::{Migrator, MigratorTrait};
use sea_orm::{ConnectionTrait, DatabaseConnection};
use std::net::SocketAddr;
#[derive(Debug, clap::Parser)]
struct Config {
@@ -28,8 +28,7 @@ struct Config {
async fn health_check(
Extension(db): Extension<DatabaseConnection>,
) -> Result<&'static str, AppError> {
db.execute_unprepared("SELECT 1")
.await?;
db.execute_unprepared("SELECT 1").await?;
Ok("Ok")
}