Skip to content

Commit

Permalink
Default values fix
Browse files Browse the repository at this point in the history
  • Loading branch information
squadgazzz committed Dec 20, 2024
1 parent 98566e5 commit c639068
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/driver/src/infra/config/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ fn default_max_order_age() -> Option<Duration> {
}

#[serde_as]
#[derive(Debug, Default, Deserialize)]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
pub struct BadTokenDetectionConfig {
/// How long should the token quality computed by the simulation
Expand All @@ -695,6 +695,12 @@ pub struct BadTokenDetectionConfig {
pub metrics_bad_token_required_measurements: u32,
}

impl Default for BadTokenDetectionConfig {
fn default() -> Self {
serde_json::from_str("{}").expect("BadTokenDetectionConfig uses default values")
}
}

fn default_simulation_bad_token_max_age() -> Duration {
Duration::from_secs(600)
}
Expand Down

0 comments on commit c639068

Please sign in to comment.