mirror of
https://github.com/sadoyan/aralez.git
synced 2026-04-29 22:38:36 +08:00
Compare dashmaps
This commit is contained in:
@@ -153,6 +153,7 @@ pub fn build_upstreams(d: &str, kind: &str) -> UpstreamMap {
|
||||
|
||||
pub fn build_upstreams2(d: &str, kind: &str) -> UpstresmDashMap {
|
||||
let upstreams: UpstresmDashMap = DashMap::new();
|
||||
let hopar: UpstresmDashMap = DashMap::new();
|
||||
let mut contents = d.to_string();
|
||||
match kind {
|
||||
"filepath" => {
|
||||
@@ -209,7 +210,14 @@ pub fn build_upstreams2(d: &str, kind: &str) -> UpstresmDashMap {
|
||||
.or_insert_with(|| (Vec::new(), AtomicUsize::new(0)))
|
||||
.0
|
||||
.push((ip.to_string(), port, ssl, proto.to_string()));
|
||||
let entry = hopar.entry(hostname.to_string()).or_insert_with(DashMap::new);
|
||||
entry
|
||||
.entry(path.to_string())
|
||||
.or_insert_with(|| (Vec::new(), AtomicUsize::new(0)))
|
||||
.0
|
||||
.push((ip.to_string(), port, ssl, proto.to_string()));
|
||||
}
|
||||
|
||||
// println!("\n\nResult ===> {} <===\n\n", dam(&hopar, &upstreams));
|
||||
// println!("{:?}", hopar);
|
||||
upstreams
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user