Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanatnight committed Mar 11, 2024
1 parent 8e7b84a commit ad35d42
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions server/src/handlers/http/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ use std::pin::Pin;
use std::sync::Arc;
use std::time::Instant;

use arrow_schema::Schema;
use crate::handlers::http::send_schema_request;
use arrow_schema::Schema;

use crate::event::commit_schema;
use crate::metrics::QUERY_EXECUTE_TIME;
Expand Down Expand Up @@ -80,20 +80,16 @@ pub async fn query(req: HttpRequest, query_request: Query) -> Result<impl Respon
}
}

let mmem = if CONFIG.parseable.mode == Mode::Query {
let mut mmem = None;

if CONFIG.parseable.mode == Mode::Query {
// create a new query to send to the ingestors
if let Some(que) = transform_query_for_ingestor(&query_request) {
let vals = send_request_to_ingestor(&que)
.await
.map_err(|err| QueryError::Custom(err.to_string()))?;

Some(vals)
} else {
None
if let Ok(vals) = send_request_to_ingestor(&que).await {
mmem = Some(vals);
}
}
} else {
None
};
}

let creds = extract_session_key_from_req(&req).expect("expects basic auth");
let permissions = Users.get_permissions(&creds);
Expand Down

0 comments on commit ad35d42

Please sign in to comment.