summaryrefslogtreecommitdiff
path: root/angelsharkd/src/routes/extensions/mod.rs
diff options
context:
space:
mode:
authorCarpenter, Adam (CORP) <adam.carpenter@adp.com>2021-11-29 13:52:11 -0500
committerCarpenter, Adam (CORP) <adam.carpenter@adp.com>2021-11-29 13:52:11 -0500
commitd65e36a4b6f2e28d25ed2996a94db17a7ae9abd9 (patch)
tree687a232a06cc6e5a5eda1fac77892c969eb66536 /angelsharkd/src/routes/extensions/mod.rs
parent91d8810402ae8e1173a3c064519c9f1b03e13224 (diff)
downloadaltruistic-angelshark-d65e36a4b6f2e28d25ed2996a94db17a7ae9abd9.tar.xz
altruistic-angelshark-d65e36a4b6f2e28d25ed2996a94db17a7ae9abd9.zip
refactor: static global and once_cell depends
Diffstat (limited to 'angelsharkd/src/routes/extensions/mod.rs')
-rw-r--r--angelsharkd/src/routes/extensions/mod.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/angelsharkd/src/routes/extensions/mod.rs b/angelsharkd/src/routes/extensions/mod.rs
index 5628588..b1c5aa3 100644
--- a/angelsharkd/src/routes/extensions/mod.rs
+++ b/angelsharkd/src/routes/extensions/mod.rs
@@ -1,3 +1,5 @@
+use std::sync::{Arc, Mutex};
+
use crate::config::Config;
use warp::{path, Filter, Rejection, Reply};
@@ -13,9 +15,13 @@ pub fn filter(config: &Config) -> impl Filter<Extract = impl Reply, Error = Reje
let filters = default().or(default());
#[cfg(feature = "simple_search")]
+ let runner = config.runner.clone();
+ #[cfg(feature = "simple_search")]
+ let haystack = simple_search::Haystack::new();
+ #[cfg(feature = "simple_search")]
let filters = filters
- .or(simple_search::search(config))
- .or(simple_search::refresh(config));
+ .or(simple_search::search(haystack.clone()))
+ .or(simple_search::refresh(runner, haystack));
#[cfg(feature = "simple_deprov")]
let filters = filters.or(simple_deprov::filter());