added update_rule for incremental change
This commit is contained in:
@@ -21,21 +21,12 @@ pub struct Config {
|
||||
/// If set to "true", enables automatic VPN rotation between sessions
|
||||
#[serde(default)]
|
||||
pub enable_vpn_rotation: bool,
|
||||
|
||||
/// Number of tasks per session before rotating VPN
|
||||
/// If set to 0, rotates VPN between economic and corporate phases
|
||||
#[serde(default = "default_tasks_per_session")]
|
||||
pub tasks_per_vpn_session: usize,
|
||||
}
|
||||
|
||||
fn default_max_parallel_instances() -> usize {
|
||||
10
|
||||
}
|
||||
|
||||
fn default_tasks_per_session() -> usize {
|
||||
0 // 0 = rotate between economic/corporate
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
@@ -45,7 +36,6 @@ impl Default for Config {
|
||||
max_parallel_instances: default_max_parallel_instances(),
|
||||
max_tasks_per_instance: 0,
|
||||
enable_vpn_rotation: false,
|
||||
tasks_per_vpn_session: default_tasks_per_session(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,11 +83,6 @@ impl Config {
|
||||
.parse::<bool>()
|
||||
.context("Failed to parse ENABLE_VPN_ROTATION as bool")?;
|
||||
|
||||
let tasks_per_vpn_session: usize = dotenvy::var("TASKS_PER_VPN_SESSION")
|
||||
.unwrap_or_else(|_| "0".to_string())
|
||||
.parse()
|
||||
.context("Failed to parse TASKS_PER_VPN_SESSION as usize")?;
|
||||
|
||||
Ok(Self {
|
||||
economic_start_date,
|
||||
corporate_start_date,
|
||||
@@ -105,7 +90,6 @@ impl Config {
|
||||
max_parallel_instances,
|
||||
max_tasks_per_instance,
|
||||
enable_vpn_rotation,
|
||||
tasks_per_vpn_session,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user