diff options
author | Adam Carpenter <adam.carpenter@adp.com> | 2021-12-10 14:15:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 14:15:06 -0500 |
commit | d3e1b697fec543e0197f1c549164c210504dde3b (patch) | |
tree | e10ec339108a8f8dbd2dd0f4737d580a0fc26ac1 /angelsharkd/src/routes/extensions/simple_search | |
parent | 3eb745f153873d537bdc788170fc878543e7899e (diff) | |
parent | f98a1fa3035fb4834441ead1cce6710739312e14 (diff) | |
download | altruistic-angelshark-d3e1b697fec543e0197f1c549164c210504dde3b.tar.xz altruistic-angelshark-d3e1b697fec543e0197f1c549164c210504dde3b.zip |
Merge pull request #6 from adpllc/extensions/simple_deprov
Simple Deprov Extension
Diffstat (limited to 'angelsharkd/src/routes/extensions/simple_search')
-rw-r--r-- | angelsharkd/src/routes/extensions/simple_search/mod.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/angelsharkd/src/routes/extensions/simple_search/mod.rs b/angelsharkd/src/routes/extensions/simple_search/mod.rs index 5b5dc8e..159137a 100644 --- a/angelsharkd/src/routes/extensions/simple_search/mod.rs +++ b/angelsharkd/src/routes/extensions/simple_search/mod.rs @@ -21,7 +21,7 @@ pub fn search_filter( .and(post()) .and(content_length_limit(1024 * 16)) .and(json()) - .and_then(move |terms: Needles| search(haystack.to_owned(), terms)) + .and_then(move |needles: Needles| search(haystack.to_owned(), needles)) .with(with::header(header::PRAGMA, "no-cache")) .with(with::header(header::CACHE_CONTROL, "no-store, max-age=0")) .with(with::header(header::X_FRAME_OPTIONS, "DENY")) @@ -39,8 +39,6 @@ pub fn refresh_filter( /// Runs the search request to find all needles in the haystack and converts the /// results into a reply. async fn search(haystack: Haystack, needles: Needles) -> Result<impl Reply, Infallible> { - // Ok(haystack.search(Vec::new())?) - // if let Ok(matches = haystack.search(needle); match haystack.search(needles) { Ok(matches) => Ok(reply::with_status(reply::json(&matches), StatusCode::OK)), Err(e) => Ok(reply::with_status( @@ -56,7 +54,7 @@ async fn refresh(haystack: Haystack) -> Result<impl Reply, Infallible> { // Run refresh as a background task and immediately return. tokio::spawn(async move { if let Err(e) = haystack.refresh() { - error!("{}", e.to_string()); // TODO: use logger + error!("{}", e.to_string()); } else { info!("Search haystack refreshed."); } |