Skip to content

Instantly share code, notes, and snippets.

@jayhuang75
Last active April 27, 2022 16:11
Show Gist options
  • Select an option

  • Save jayhuang75/e0643ed11cb28730b55d4338be95291c to your computer and use it in GitHub Desktop.

Select an option

Save jayhuang75/e0643ed11cb28730b55d4338be95291c to your computer and use it in GitHub Desktop.
rust-velocity-limit-tracking-struct
lazy_static! {
pub static ref DAILY_TRANSACTIONS: Mutex<DashMap<String, i32>> = Mutex::new(DashMap::new());
pub static ref WEEKLY_TRANSACTIONS: Mutex<DashMap<String, f64>> = Mutex::new(DashMap::new());
pub static ref TRANSACTION_ID_COUNT: Mutex<DashMap<String, i32>> = Mutex::new(DashMap::new());
}
#[derive(Debug, Serialize)]
pub struct Output {
pub id: String,
pub customer_id: String,
pub accept: bool
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment