Skip to content

Commit

Permalink
feat(archive-downloader): check if archive downloader not ready yet
Browse files Browse the repository at this point in the history
  • Loading branch information
pashinov committed Feb 10, 2025
1 parent 1ee420f commit add772c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions archives-downloader/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ impl ArchiveDownloader {
}

async fn try_download(&self, seqno: u32) -> Result<Option<ArchiveInfo>> {
if self.archive_ids.read().is_empty() {
anyhow::bail!("archive downloader not ready seqno = {seqno}")
}

let id = self
.archive_ids
.read()
Expand All @@ -428,6 +432,8 @@ impl ArchiveDownloader {
const ARCHIVE_PACKAGE_SIZE: u32 = 100;

if seqno - id >= ARCHIVE_PACKAGE_SIZE {
// tracing::warn!(seqno, "archive too new");
// return Ok(None);
anyhow::bail!("archive too new seqno = {seqno}")
}
(id as _, NonZeroU64::new(size as _).unwrap())
Expand Down

0 comments on commit add772c

Please sign in to comment.