From 9ec566ef1056b49c0b9afc26b7812662e344dc55 Mon Sep 17 00:00:00 2001 From: donpat1to Date: Fri, 29 Aug 2025 23:50:58 +0200 Subject: [PATCH] parsing after server and app --- WatcherAgent/src/config.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/WatcherAgent/src/config.rs b/WatcherAgent/src/config.rs index 5b6e038..c569b26 100644 --- a/WatcherAgent/src/config.rs +++ b/WatcherAgent/src/config.rs @@ -26,9 +26,14 @@ impl Settings { let builder = config::Config::builder() .add_source(File::with_name("Settings").required(false)) .add_source( - Environment::default() - .separator("_") // "APP" maps to struct `app` - .try_parsing(true), + Environment::with_prefix("APP") + .separator("_") + .prefix_separator("_"), + ) + .add_source( + Environment::with_prefix("SERVER") + .separator("_") + .prefix_separator("_"), ); builder.build()?.try_deserialize()