Skip to content

Commit

Permalink
Remove unused fields from datasets.json
Browse files Browse the repository at this point in the history
  • Loading branch information
kalabukdima committed Sep 16, 2024
1 parent 4969dd5 commit a211900
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion crates/network-scheduler/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,28 @@ impl S3Storage {

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) {
let chunks = chunks_summary
.iter()
.map(|(ds, chunks)| {
(
ds.clone(),
chunks
.iter()
.map(|c| {
serde_json::json!({
"begin": c.begin,
"end": c.end,
"size_bytes": c.size_bytes,
})
})
.collect(),
)
})
.collect::<serde_json::Map<_, _>>();
let json = serde_json::json!({
"chunks": chunks
});
let future = match serde_json::to_vec(&json) {
Ok(bytes) => Some(
self.client
.put_object()
Expand Down

0 comments on commit a211900

Please sign in to comment.