silence clippy and python formatting warning

This commit is contained in:
Heikki Linnakangas
2025-07-14 19:46:01 +03:00
parent 1e49678f29
commit 276758e868
4 changed files with 5 additions and 20 deletions

View File

@@ -69,26 +69,12 @@ pub(in crate::http) async fn get_autoscaling_metrics(
.context("fetching metrics from Postgres metrics service")
.map_err(|e| JsonResponse::error(StatusCode::INTERNAL_SERVER_ERROR, format!("{e:#}")))?;
// Check response status
let status = resp.status();
if status != StatusCode::OK {
return Err(JsonResponse::error(
status,
format!(
"Postgres metrics service returned error: {}",
status.to_string()
),
));
}
// Build an OK response, with the body forwarded from the response we got.
// Build a response that just forwards the response we got.
let mut response = Response::builder();
response = response.status(StatusCode::OK);
response = response.status(resp.status());
if let Some(content_type) = resp.headers().get(CONTENT_TYPE) {
response = response.header(CONTENT_TYPE, content_type);
}
let body = tonic::service::AxumBody::from_stream(resp.into_body().into_data_stream());
Ok(response.body(body).unwrap())
}

View File

@@ -88,8 +88,8 @@ where
// spawn a task to poll the connection and drive the HTTP state
tokio::spawn(async move {
if let Err(e) = connection.await {
eprintln!("Error in connection: {}", e);
if let Err(err) = connection.await {
eprintln!("Error in connection: {err}");
}
});

View File

@@ -19,7 +19,7 @@ impl LfcMetricsCollector {
"lfc_approximate_working_set_size_windows",
"Approximate working set size in pages of 8192 bytes",
),
&[&"duration_seconds"],
&["duration_seconds"],
)
.unwrap();

View File

@@ -1,7 +1,6 @@
from __future__ import annotations
import time
from logging import debug
from pathlib import Path
from typing import TYPE_CHECKING