Spaces:
Running
Running
ddotthomas
commited on
Commit
·
286bcf1
1
Parent(s):
bfeb812
fix: added a config parse backup
Browse files- src/server/routes/search.rs +10 -0
src/server/routes/search.rs
CHANGED
@@ -139,6 +139,16 @@ async fn results(
|
|
139 |
// We sort the list of engine so the cache keys will match between users. The cookie's list of engines is unordered.
|
140 |
engines.sort();
|
141 |
cache_key = cache_key + &(engines.join(""));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
|
144 |
// fetch the cached results json.
|
|
|
139 |
// We sort the list of engine so the cache keys will match between users. The cookie's list of engines is unordered.
|
140 |
engines.sort();
|
141 |
cache_key = cache_key + &(engines.join(""));
|
142 |
+
} else {
|
143 |
+
let mut engines: Vec<String> = config
|
144 |
+
.upstream_search_engines
|
145 |
+
.iter()
|
146 |
+
.filter(|map| *map.1)
|
147 |
+
.map(|map| String::from(&(*map.0)))
|
148 |
+
.collect();
|
149 |
+
|
150 |
+
engines.sort();
|
151 |
+
cache_key = cache_key + &(engines.join(""));
|
152 |
}
|
153 |
|
154 |
// fetch the cached results json.
|