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

tweak: change log error! -> warn! for lens deserialization issues #310

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions crates/spyglass/src/documents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub async fn delete_documents_by_uri(state: &AppState, uri: Vec<String>) {
}
}

#[derive(Default)]
pub struct AddUpdateResult {
pub num_added: usize,
pub num_updated: usize,
Expand All @@ -74,6 +75,10 @@ pub async fn process_crawl_results(
results: &[CrawlResult],
global_tags: &[TagPair],
) -> anyhow::Result<AddUpdateResult> {
if results.is_empty() {
return Ok(AddUpdateResult::default());
}

let now = Instant::now();
// get a list of all urls
let parsed_urls = results
Expand Down
2 changes: 1 addition & 1 deletion crates/spyglass/src/search/lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub async fn read_lenses(config: &Config) -> anyhow::Result<DashMap<String, Lens
let path = entry.path();
if path.is_file() && path.extension().unwrap_or_default() == "ron" {
match LensConfig::from_path(path) {
Err(err) => log::error!("Unable to load lens {:?}: {}", entry.path(), err),
Err(err) => log::warn!("Unable to load lens {:?}: {}", entry.path(), err),
Ok(lens) => {
if lens.is_enabled {
lens_map.insert(lens.name.clone(), lens);
Expand Down