mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 09:38:21 +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:
|
if env_file_vars:
|
||||||
for env_name, env_val in env_file_vars.items():
|
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:
|
try:
|
||||||
env_val = self.__config__.json_loads(env_val)
|
env_val = self.__config__.json_loads(env_val)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user