mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-20 04:44:46 +08:00
Enforces config env var checks and improves startup handling (#892)
* Enforces config env var checks and improves startup handling Ensures critical environment variables are validated during config resolution, raising clear errors if missing. Improves server startup reliability by verifying that backend services are listening and by terminating on misconfiguration at launch. Adds more robust feedback to developers when API startup fails, reducing silent misconfigurations and speeding up troubleshooting. * Initial plan * Implement suggestions from PR #892: fix env var checks and improve error logging Co-authored-by: foreleven <4785594+foreleven@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: foreleven <4785594+foreleven@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
@@ -113,7 +113,10 @@ class AppConfig(BaseModel):
|
||||
"""
|
||||
if isinstance(config, str):
|
||||
if config.startswith("$"):
|
||||
return os.getenv(config[1:], config)
|
||||
env_value = os.getenv(config[1:])
|
||||
if env_value is None:
|
||||
raise ValueError(f"Environment variable {config[1:]} not found for config value {config}")
|
||||
return env_value
|
||||
return config
|
||||
elif isinstance(config, dict):
|
||||
return {k: cls.resolve_env_variables(v) for k, v in config.items()}
|
||||
|
||||
Reference in New Issue
Block a user