How does MergeConfig work ? #1294
Unanswered
srinidhis94
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using viper and I have to load a file which has 35K lines. It roughly takes 150-200ms to load. Our design is such that this configuration can keep changing. So we always reload the file whenever it changes. We have an event watcher. The problem I am seeing is during the reload, <200ms, I am not able to read any configuration. This is causing failures in our service. Until configs are updated, i can afford previous config value but not nil/empty values. Also, i don't mind having a blocking get call until configs are loaded as I can afford to wait 200ms .
I was going to other options. MergeConfig also seems to help with my case as we can still access older values until they are overwritten. By looking at the code, it looks like we only update keys which already exist in the config and the data type matches exactly. Is my understanding correct ? If key 'k' is present in src but not in tgt or if key k has value of type t1 in src and t2 in tgt. We wouldn't merge the maps in this case is it ?
Beta Was this translation helpful? Give feedback.
All reactions