Something is ok (cleanup)

This commit is contained in:
Ara Sadoyan
2025-02-08 19:40:14 +01:00
parent 79d952d30e
commit 5b65a6dc4e
4 changed files with 10 additions and 7 deletions

View File

@@ -1 +1,2 @@
pub mod compare;
pub mod tools;

View File

@@ -1,6 +1,7 @@
use dashmap::DashMap;
use std::sync::atomic::AtomicUsize;
#[allow(dead_code)]
pub fn dashmaps(map1: &DashMap<String, (Vec<(String, u16)>, AtomicUsize)>, map2: &DashMap<String, (Vec<(String, u16)>, AtomicUsize)>) -> bool {
if map1.len() != map2.len() {
return false; // Different number of keys

7
src/utils/tools.rs Normal file
View File

@@ -0,0 +1,7 @@
use std::any::type_name;
#[allow(dead_code)]
pub fn typeoff<T>(_: T) {
let to = type_name::<T>();
println!("{:?}", to);
}

View File

@@ -1,4 +1,5 @@
use crate::utils::compare;
// use crate::utils::tools::*;
use async_trait::async_trait;
use dashmap::DashMap;
use log::{info, warn};
@@ -8,19 +9,12 @@ use pingora_core::server::ShutdownWatch;
use pingora_core::services::background::BackgroundService;
use pingora_http::{RequestHeader, ResponseHeader};
use pingora_proxy::{ProxyHttp, Session};
use std::any::type_name;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::RwLock;
use tokio::time::interval;
#[allow(dead_code)]
pub fn typeoff<T>(_: T) {
let to = type_name::<T>();
println!("{:?}", to);
}
pub struct LB {
pub upstreams_map: Arc<RwLock<DashMap<String, (Vec<(String, u16)>, AtomicUsize)>>>,
}