mirror of
https://github.com/sadoyan/aralez.git
synced 2026-04-29 22:38:36 +08:00
Something is ok (cleanup)
This commit is contained in:
@@ -1 +1,2 @@
|
||||
pub mod compare;
|
||||
pub mod tools;
|
||||
|
||||
@@ -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
7
src/utils/tools.rs
Normal 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);
|
||||
}
|
||||
@@ -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)>>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user