Skip to content
Snippets Groups Projects
Verified Commit f1845ab6 authored by cyrinux's avatar cyrinux :construction_worker_tone1:
Browse files

chore: wip

parent 3538cf28
Branches dev
No related tags found
No related merge requests found
Pipeline #34694 passed
......@@ -42,24 +42,22 @@ class ConfigManager(dict):
def init_app(self, app):
self.config.update(app.config)
# get environment variables
self.config.update(
{
key: self.__coerce_value(os.environ.get(key, value))
for key, value in DEFAULT_CONFIG.items()
}
)
self.config.update(
{
key: self.__coerce_value(os.environ.get(key, value))
for key, value in self.get_config_by_prefix("CACHE_").items()
}
)
# update the logging config if necessary
# Get environment variables for all keys
self.config.update({
key: self.__coerce_value(os.environ.get(key, value))
for key, value in DEFAULT_CONFIG.items()
})
# Ensure environment variables for CACHE_ keys are handled
self.config.update({
key: self.__coerce_value(os.environ.get(key, DEFAULT_CONFIG.get(key)))
for key in os.environ.keys() if key.startswith('CACHE_')
})
# Update the logging config if necessary
if self.config.get("DEBUG", False):
logging.basicConfig(level=logging.DEBUG)
# update the app config itself
# Update the app config itself
app.config = self
def setdefault(self, key, value):
if key not in self.config:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment