Open jerluc opened 3 years ago
Note that there are a couple of minor implementation wrinkles that would need to be addressed in order to support this new feature:
sync.RWMutex
is probably most appropriate for this use case) to ensure that when the configuration is being applied to the running server, we at least retain memory consistency within a single request. Furthermore, since the configuration can also change the cache, this control mechanism/semaphore will need to lock readers before the caching middleware is invoked
There are some use cases in which it would make sense for tilenol to be able to auto-reload its configuration.
For example, when tilenol's configuration is mounted as a file from a
ConfigMap
in a Kubernetes environment, theConfigMap
may change when someone applies a new configuration viakubectl
, but tilenol does not update since it only ever reads the configuration from disk on boot. Notably there are some temporary workarounds for this particular scenario, e.g. Reloader, but it might make more sense to simply add a new CLI flag, e.g.--reload
, to support automatically watching for configuration file changes.