Skip to content

Commit 904fc8a

Browse files
committed
fix: query fail when an Ingest Server is down
1 parent 5e124da commit 904fc8a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/src/handlers/http.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mod kinesis;
3030
pub(crate) mod llm;
3131
pub(crate) mod logstream;
3232
pub(crate) mod middleware;
33-
pub(crate) mod modal;
33+
pub mod modal;
3434
pub(crate) mod oidc;
3535
mod otel;
3636
pub(crate) mod query;
@@ -108,9 +108,10 @@ pub async fn send_query_request_to_ingester(query: &Query) -> anyhow::Result<Vec
108108
.header(http::header::AUTHORIZATION, im.token.clone())
109109
.header(http::header::CONTENT_TYPE, "application/json")
110110
.send()
111-
.await?;
111+
.await;
112112

113-
if reqw.status().is_success() {
113+
if let Ok(reqw) = reqw {
114+
// do i need to do a success check??
114115
let v: Value = serde_json::from_slice(&reqw.bytes().await?)?;
115116
// the value returned is an array of json objects
116117
// so it needs to be flattened

0 commit comments

Comments
 (0)