Allow loading config vars from env#137
Conversation
This allows overriding the configuration files by reading from the environment any config vars prefixed with RECCEIVER_
The healthcheck is not working on channelfinder since 5.0.0
| result = self.get(key) | ||
| if result is None: | ||
| raise KeyError("No option value") |
There was a problem hiding this comment.
Can just do return self[key] (or is that ValueError?)
There was a problem hiding this comment.
I think it is ConfigParser.NoOptionError
There was a problem hiding this comment.
If you did dict[key] access with try-except you can get exception chaining, but not sure if that's better or not. Your call.
There was a problem hiding this comment.
I think self is not a dictionary. I think it is a wrapper around ConfigParser. I think you have to use get.
anderslindho
left a comment
There was a problem hiding this comment.
Isn't the ordering a bit strange here, that env vars - which are implicitly read - are prioritised over a config file?
Its the same hierachy as spring-boot https://docs.spring.io/spring-boot/reference/features/external-config.html |
For whatever reason no log on init Guessing the logger hasn't setup at this point.
Set to all uppercase so clear it is an env variable
|



This allows overriding the configuration files by reading from the environment any config vars prefixed with RECCEIVER_