woah
so what are these? auto gc and typed observation (because some flett shit is depending on ts) Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -102,6 +102,10 @@ pub fn write_init_config(args: &InitConfigArgs) -> Result<Option<PathBuf>> {
|
||||
.or(base.enroll_token_ttl_seconds)
|
||||
.unwrap_or(86_400)
|
||||
.max(1),
|
||||
observation_retention_seconds: args
|
||||
.observation_retention_seconds
|
||||
.or(base.observation_retention_seconds)
|
||||
.unwrap_or(2_592_000),
|
||||
pid_file,
|
||||
ui_dist_dir,
|
||||
bootstrap_enroll_tokens,
|
||||
@@ -155,6 +159,7 @@ pub fn bootstrap_config_if_missing(args: &ServeArgs) -> Result<bool> {
|
||||
ui_dist_dir: args.ui_dist_dir.clone(),
|
||||
command_timeout_ms: args.command_timeout_ms,
|
||||
enroll_token_ttl_seconds: args.enroll_token_ttl_seconds,
|
||||
observation_retention_seconds: args.observation_retention_seconds,
|
||||
bootstrap_enroll_tokens: args.bootstrap_enroll_tokens.clone(),
|
||||
from_config: None,
|
||||
telemetry_otlp_endpoint: None,
|
||||
@@ -219,6 +224,7 @@ json_logs = true
|
||||
ui_dist_dir: None,
|
||||
command_timeout_ms: Some(999),
|
||||
enroll_token_ttl_seconds: None,
|
||||
observation_retention_seconds: None,
|
||||
bootstrap_enroll_tokens: Vec::new(),
|
||||
telemetry_otlp_endpoint: None,
|
||||
telemetry_service_name: None,
|
||||
|
||||
@@ -66,6 +66,12 @@ impl DaemonConfig {
|
||||
.max(1),
|
||||
);
|
||||
|
||||
let observation_retention = Duration::from_secs(
|
||||
args.observation_retention_seconds
|
||||
.or(file.observation_retention_seconds)
|
||||
.unwrap_or(2_592_000),
|
||||
);
|
||||
|
||||
let pid_file_raw = args
|
||||
.pid_file
|
||||
.clone()
|
||||
@@ -94,6 +100,7 @@ impl DaemonConfig {
|
||||
state_file,
|
||||
command_timeout,
|
||||
enroll_token_ttl,
|
||||
observation_retention,
|
||||
pid_file,
|
||||
ui_dist_dir,
|
||||
bootstrap_enroll_tokens,
|
||||
|
||||
@@ -12,6 +12,7 @@ pub struct DaemonConfig {
|
||||
pub state_file: PathBuf,
|
||||
pub command_timeout: Duration,
|
||||
pub enroll_token_ttl: Duration,
|
||||
pub observation_retention: Duration,
|
||||
pub pid_file: PathBuf,
|
||||
pub ui_dist_dir: PathBuf,
|
||||
pub bootstrap_enroll_tokens: Vec<String>,
|
||||
@@ -43,6 +44,7 @@ pub(crate) struct FileConfig {
|
||||
pub(crate) state_file: Option<PathBuf>,
|
||||
pub(crate) command_timeout_ms: Option<u64>,
|
||||
pub(crate) enroll_token_ttl_seconds: Option<u64>,
|
||||
pub(crate) observation_retention_seconds: Option<u64>,
|
||||
pub(crate) pid_file: Option<PathBuf>,
|
||||
pub(crate) ui_dist_dir: Option<PathBuf>,
|
||||
#[serde(alias = "enroll_tokens")]
|
||||
@@ -65,6 +67,7 @@ pub(crate) struct WritableConfig {
|
||||
pub(crate) state_file: PathBuf,
|
||||
pub(crate) command_timeout_ms: u64,
|
||||
pub(crate) enroll_token_ttl_seconds: u64,
|
||||
pub(crate) observation_retention_seconds: u64,
|
||||
pub(crate) pid_file: PathBuf,
|
||||
pub(crate) ui_dist_dir: PathBuf,
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
|
||||
Reference in New Issue
Block a user