Give HTTP not found when not figuring out prometheus metric
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user