refactoring: new structure and mailer

This commit is contained in:
Per Stark
2024-12-19 23:15:12 +01:00
parent e54533d005
commit 13608bc41e
25 changed files with 659 additions and 379 deletions

View File

@@ -0,0 +1,17 @@
use axum::{extract::State, http::StatusCode, response::IntoResponse};
use tracing::info;
use crate::{error::ApiError, server::AppState};
pub async fn queue_length_handler(
State(state): State<AppState>,
) -> Result<impl IntoResponse, ApiError> {
info!("Getting queue length");
let queue_length = state.rabbitmq_consumer.get_queue_length().await?;
info!("Queue length: {}", queue_length);
// Return the queue length with a 200 OK status
Ok((StatusCode::OK, queue_length.to_string()))
}