Skip to content

Commit

Permalink
Fix scheduler imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiezzel committed Sep 4, 2024
1 parent cece3f7 commit 5b0a1df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/network-scheduler/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ impl Cli {
let file_contents = tokio::fs::read(&self.config).await?;
let mut config: Config = serde_yaml::from_slice(file_contents.as_slice())?;
config.network = match self.transport.rpc.network {
contract_client::Network::Tethys => "tethys".to_string(),
contract_client::Network::Mainnet => "mainnet".to_string(),
sqd_contract_client::Network::Tethys => "tethys".to_string(),
sqd_contract_client::Network::Mainnet => "mainnet".to_string(),
};
CONFIG.set(config)?;
Ok(())
Expand Down
1 change: 0 additions & 1 deletion crates/network-scheduler/src/metrics_server.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::collections::HashMap;
use std::net::SocketAddr;
use std::ops::Deref;
use std::sync::Arc;
Expand Down
8 changes: 4 additions & 4 deletions crates/network-scheduler/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl DatasetStorage {

fn objects_to_chunk(
&self,
objs: impl IntoIterator<Item = S3Object>,
objs: impl IntoIterator<Item=S3Object>,
) -> anyhow::Result<DataChunk> {
let mut last_key = None;
let mut blocks_file_present = false;
Expand Down Expand Up @@ -299,7 +299,7 @@ impl S3Storage {
prometheus_metrics::s3_request();
}

pub fn save_chunks_list(&self, chunks_summary: &ChunksSummary) -> impl Future<Output = ()> {
pub fn save_chunks_list(&self, chunks_summary: &ChunksSummary) -> impl Future<Output=()> {
log::debug!("Saving chunks list");
let future = match serde_json::to_vec(&chunks_summary) {
Ok(bytes) => Some(
Expand All @@ -315,12 +315,12 @@ impl S3Storage {
None
}
};
return async move {
async move {
let Some(future) = future else { return };
if let Err(e) = future.await {
log::error!("Error saving chunks list: {e:?}");
}
prometheus_metrics::s3_request();
};
}
}
}

0 comments on commit 5b0a1df

Please sign in to comment.