storkit: merge 466_story_configurable_timezone_in_project_toml_for_timer_scheduling
This commit is contained in:
@@ -42,6 +42,11 @@ pub struct ProjectConfig {
|
||||
/// Default: `true`.
|
||||
#[serde(default = "default_rate_limit_notifications")]
|
||||
pub rate_limit_notifications: bool,
|
||||
/// IANA timezone name (e.g. `"Europe/London"`, `"America/New_York"`).
|
||||
/// When set, timer HH:MM inputs are interpreted in this timezone instead
|
||||
/// of the container/host local time. Falls back to `chrono::Local` when absent.
|
||||
#[serde(default)]
|
||||
pub timezone: Option<String>,
|
||||
}
|
||||
|
||||
/// Configuration for the filesystem watcher's sweep behaviour.
|
||||
@@ -184,6 +189,8 @@ struct LegacyProjectConfig {
|
||||
base_branch: Option<String>,
|
||||
#[serde(default = "default_rate_limit_notifications")]
|
||||
rate_limit_notifications: bool,
|
||||
#[serde(default)]
|
||||
timezone: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for ProjectConfig {
|
||||
@@ -212,6 +219,7 @@ impl Default for ProjectConfig {
|
||||
max_retries: default_max_retries(),
|
||||
base_branch: None,
|
||||
rate_limit_notifications: default_rate_limit_notifications(),
|
||||
timezone: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,6 +267,7 @@ impl ProjectConfig {
|
||||
max_retries: legacy.max_retries,
|
||||
base_branch: legacy.base_branch,
|
||||
rate_limit_notifications: legacy.rate_limit_notifications,
|
||||
timezone: legacy.timezone,
|
||||
};
|
||||
validate_agents(&config.agent)?;
|
||||
return Ok(config);
|
||||
@@ -285,6 +294,7 @@ impl ProjectConfig {
|
||||
max_retries: legacy.max_retries,
|
||||
base_branch: legacy.base_branch,
|
||||
rate_limit_notifications: legacy.rate_limit_notifications,
|
||||
timezone: legacy.timezone,
|
||||
};
|
||||
validate_agents(&config.agent)?;
|
||||
Ok(config)
|
||||
@@ -299,6 +309,7 @@ impl ProjectConfig {
|
||||
max_retries: legacy.max_retries,
|
||||
base_branch: legacy.base_branch,
|
||||
rate_limit_notifications: legacy.rate_limit_notifications,
|
||||
timezone: legacy.timezone,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user