fix: format + tracing
CI / Rust CI (push) Successful in 1m39s
Publish & Deploy / Build and Push to Registry (push) Successful in 1m37s
Publish & Deploy / Deploy via SSH (push) Successful in 18s

This commit is contained in:
2026-04-28 18:32:40 +02:00
parent 4596dfe28b
commit 4e64aab0a5
7 changed files with 48 additions and 48 deletions
+2 -2
View File
@@ -28,13 +28,13 @@ pub fn init_tracing() {
#[tokio::main]
async fn main() {
init_tracing();
#[cfg(debug_assertions)]
{
dotenvy::dotenv().ok();
}
init_tracing();
let state = AppState {
ollama: Arc::new(OllamaProvider::new(OLLAMA_URL.as_str())),
};
+1 -1
View File
@@ -41,7 +41,7 @@ pub async fn auth_middleware(mut request: Request, next: Next) -> Result<Respons
Ok(next.run(request).await)
}
Err(e) => {
eprintln!("JWT validation failed: {:?}", e);
tracing::error!("JWT validation failed: {:?}", e);
Err(StatusCode::UNAUTHORIZED)
}
}
+2
View File
@@ -51,6 +51,7 @@ pub async fn completions(
State(state): State<AppState>,
Json(body): Json<api::CompletionRequest>,
) -> Result<Response, (axum::http::StatusCode, Json<api::ErrorResponse>)> {
tracing::debug!("Received /completion with body {:?}", body);
if body.base.stream {
let stream = state.ollama.completions_stream(&body).await.map_err(|e| {
let (code, msg) = ollama_err(e);
@@ -116,6 +117,7 @@ pub async fn chat_completions(
State(state): State<AppState>,
Json(body): Json<api::ChatRequest>,
) -> Result<Response, (axum::http::StatusCode, String)> {
tracing::debug!("Received /completion with body {:?}", body);
if body.base.stream {
let stream = state
.ollama