Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up reading metadata from file #84

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
3 changes: 2 additions & 1 deletion databroker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ async fn read_metadata_file<'a, 'b>(
let path = filename.trim();
info!("Populating metadata from file '{}'", path);
let metadata_file = std::fs::OpenOptions::new().read(true).open(filename)?;
let entries = vss::parse_vss_from_reader(&metadata_file)?;
let buffered = std::io::BufReader::new(metadata_file);
let entries = vss::parse_vss_from_reader(buffered)?;

for (path, entry) in entries {
debug!("Adding VSS datapoint type {}", path);
Expand Down