mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 14:10:37 +00:00
silence clippy and python formatting warning
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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}");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
from logging import debug
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
||||
Reference in New Issue
Block a user