1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
f1a832f445 Give HTTP not found when not figuring out prometheus metric 2025-05-08 21:41:37 +02:00
84180691a4 Update nixpkgs 2025-05-08 21:37:27 +02:00
2 changed files with 4 additions and 4 deletions

6
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1672350804,
"narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=",
"lastModified": 1746461020,
"narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6",
"rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae",
"type": "github"
},
"original": {

View File

@@ -128,7 +128,7 @@ async fn check(State(app_state): State<AppState>, Query(params): Query<HashMap<S
.map_err(|_err| (StatusCode::INTERNAL_SERVER_ERROR, "Invalid response from Prometheus"))?;
let current_system_hash = prometheus_body["data"]["result"][0]["metric"]["hash"].as_str()
.ok_or_else(|| (StatusCode::INTERNAL_SERVER_ERROR, "No current metric found in Prometheus"))?;
.ok_or_else(|| (StatusCode::NOT_FOUND, "No current metric found in Prometheus"))?;
let hydra_req = client.get(format!("{}/job/{}/latest", app_state.hydra_url, app_state.hydra_job_template.clone().replace("{}", target)))
.header("Accept", "application/json")