Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanatnight committed Feb 24, 2024
1 parent 72186b4 commit a802a71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
7 changes: 4 additions & 3 deletions server/src/handlers/http/modal/query_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl ParseableServer for QueryServer {

// on subsequent runs, the qurier should check if the ingestor is up and running or not
for ingester in data.iter() {
dbg!(&ingester);
// dbg!(&ingester);
// yes the format macro does not need the '/' ingester.origin already
// has '/' because Url::Parse will add it if it is not present
// uri should be something like `http://address/api/v1/liveness`
Expand Down Expand Up @@ -165,7 +165,7 @@ impl QueryServer {

let mut f = Self::get_meta_file().await;
// writer the arr in f
let write_size = f.write(serde_json::to_string(&arr)?.as_bytes()).await?;
let _ = f.write(serde_json::to_string(&arr)?.as_bytes()).await?;
Ok(arr)
}

Expand Down Expand Up @@ -224,11 +224,12 @@ impl QueryServer {
Ok(())
}

#[allow(dead_code)]
async fn sync_ingestor_metadata() {
let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(60 / 10));
loop {
interval.tick().await;
dbg!("Tick");
// dbg!("Tick");
Self::get_ingestor_info().await.unwrap();
}
}
Expand Down
14 changes: 5 additions & 9 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ async fn main() -> anyhow::Result<()> {

// these are empty ptrs so mem footprint should be minimal
let server: Arc<dyn ParseableServer> = match CONFIG.parseable.mode {
Mode::Query => {
Arc::new(QueryServer)
}
Mode::Ingest => {
Arc::new(IngestServer)
}
Mode::All => {
Arc::new(Server)
}
Mode::Query => Arc::new(QueryServer),

Mode::Ingest => Arc::new(IngestServer),

Mode::All => Arc::new(Server),
};

// add logic for graceful shutdown if
Expand Down

0 comments on commit a802a71

Please sign in to comment.