mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Add an API to load default configuration values (#13788)
Currently we have RedisModule_LoadConfigs which the module is expected to call during OnLoad which sets the configuration values from the config queue or it sets the default value. The problem is that the module might still want to support loading values from the command line. If we want to give precedence to the config file values then it means the module needs to set the values before calling the Load Config function. The problem is that then the API overrides the variables which were set from the module command line with default values. The new API should solve that in the following way. 1.Module registers its configuration parameters with redis 2.Module calls RedisModule_LoadDefaultConfigs which loads the default values for all the registered configuration parameters of the module 3.Module sets the variables internally using the values it got from the command line 4.Module calls RedisModule_LoadConfigs which will set the values based on the redis configuration file. This allows for the default values to be set, for the module to override them and for redis to override what the module wrote. In short it determines a logical flow and ordering of where the values for the parameters should come from. The change done by all these previous commits:d9134f8f97a40fd630b9361ad5f83c034855f164012c198be450f10f6e3a827de4e92ac349455c43ac2694fb69c88f9fe26855ec46a6f7353db7e294492dbf192799539a8850a8d3f35ad8231a03477349fd5c32588Co-authored-by: YaacovHazan <yaacov.hazan@redislabs.com>
This commit is contained in: