-
So in my app which I'm running as a Docker container, before every download job I'm loading the configuration file located at from gallery_dl import config, job
def download(url):
config.load()
job.DownloadJob(url).run() Which initially works as expected. However, I set it up like this so that any changes to the config file while the app is running should be loaded before every download, which isn't happening: it only uses the first configuration that is loaded, so I have to re-create the container for it to use the updated configuration file. Does |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hang on, I may have figured something out. It could be a Linux/Docker issue rather than Would still like some clarification on whether Edit: It does, closing this discussion. |
Beta Was this translation helpful? Give feedback.
-
It doesn't remove deleted entries though. For example a
I'd recommend |
Beta Was this translation helpful? Give feedback.
config.load()
does pick up changes when called multiple times.It doesn't remove deleted entries though. For example a
"foo": "bar"
setting picked up during the firstload()
will still stay in the global config dict (config._config
) after deleting it from the config file and callingload()
a second time. It only ever adds new values or updates existing ones.I'd recommend
clear()
beforeload()
, but directly modifyingconfig._config
throughupdate()
and so on works as well and is probably faster. Make sure not to replace the existing config dict with a new one, though.