mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
🔧 load extra config value from env if empty in file
This commit is contained in:
parent
adc69a2763
commit
50601934b9
@ -79,6 +79,9 @@ class BaseConfig(BaseSettings):
|
||||
|
||||
if env_file_vars:
|
||||
for env_name, env_val in env_file_vars.items():
|
||||
if (env_val is None or
|
||||
len(env_val) == 0) and env_name in env_vars:
|
||||
env_val = env_vars[env_name]
|
||||
try:
|
||||
env_val = self.__config__.json_loads(env_val)
|
||||
except ValueError as e:
|
||||
|
Loading…
Reference in New Issue
Block a user