Skip to content

Commit

Permalink
Quickly go over TALs before doing anything.
Browse files Browse the repository at this point in the history
  • Loading branch information
partim committed Sep 25, 2018
1 parent acfa3c9 commit f0b0548
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -2,5 +2,4 @@
/target/
**/*.rs.bk
/rpki-cache/repository
/rpki-cache/tal/arin.tal
/.cargo
7 changes: 6 additions & 1 deletion src/repository.rs
Expand Up @@ -70,10 +70,15 @@ impl Repository {
strict: bool,
rsync: bool
) -> Result<Self, ProcessingError> {
let base = base.as_ref().into();
let base = PathBuf::from(base.as_ref());
if let Err(err) = fs::read_dir(&base) {
return Err(ProcessingError::BadRepository(err))
}

// Let’s quickly go over the TALs to break as early as possible if
// they aren’t good.
for _ in Tal::read_dir(base.join("tal"))? { }

Ok(Repository(Arc::new(RepoInner {
base,
strict,
Expand Down

0 comments on commit f0b0548

Please sign in to comment.