Skip to content

Commit

Permalink
fix(fetch): fetch default icons only when fetcher is called
Browse files Browse the repository at this point in the history
  • Loading branch information
QaidVoid committed Oct 20, 2024
1 parent d37bad0 commit fdefcd5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ impl PackageRegistry {
}
};
storage.add_repository(&repo.name, packages);
}

Ok(())
}

pub async fn fetch(&mut self) -> Result<()> {
for repo in &CONFIG.repositories {
let content = self.fetcher.execute(repo).await?;

let mut de = rmp_serde::Deserializer::new(&content[..]);
let packages = RepositoryPackages::deserialize(&mut de)?;

self.storage.add_repository(&repo.name, packages);

// fetch default icons
let icon_futures: Vec<_> = repo
Expand Down Expand Up @@ -104,19 +117,6 @@ impl PackageRegistry {
Ok(())
}

pub async fn fetch(&mut self) -> Result<()> {
for repo in &CONFIG.repositories {
let content = self.fetcher.execute(repo).await?;

let mut de = rmp_serde::Deserializer::new(&content[..]);
let packages = RepositoryPackages::deserialize(&mut de)?;

self.storage.add_repository(&repo.name, packages);
}

Ok(())
}

pub async fn install_packages(
&self,
package_names: &[String],
Expand Down

0 comments on commit fdefcd5

Please sign in to comment.