Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions fact/src/host_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,17 @@ impl HostScanner {
};

for entry in glob::glob(glob_str)? {
match entry {
Ok(path) => {
if path.is_file() {
self.metrics.scan_inc(ScanLabels::FileScanned);
self.update_entry(path.as_path()).with_context(|| {
format!("Failed to update entry for {}", path.display())
})?;
} else if path.is_dir() {
self.metrics.scan_inc(ScanLabels::DirectoryScanned);
self.update_entry(path.as_path()).with_context(|| {
format!("Failed to update entry for {}", path.display())
})?;
} else {
self.metrics.scan_inc(ScanLabels::FsItemIgnored);
}
}
Err(e) => return Err(e.into()),
let path = entry?;
if path.is_file() {
self.metrics.scan_inc(ScanLabels::FileScanned);
self.update_entry(path.as_path())
.with_context(|| format!("Failed to update entry for {}", path.display()))?;
} else if path.is_dir() {
self.metrics.scan_inc(ScanLabels::DirectoryScanned);
self.update_entry(path.as_path())
.with_context(|| format!("Failed to update entry for {}", path.display()))?;
} else {
self.metrics.scan_inc(ScanLabels::FsItemIgnored);
}
}
Ok(())
Expand Down
Loading