Open matthieumarrast opened 5 months ago
ini_to_env_<module>.cache
usageIn script https://github.com/metwork-framework/mfext/blob/master/adm/templates/config_profile
command cache_get /home/<module>/tmp/ini_to_env_<module>.cache 1440
is executed to know if a cache exists and must be used.
The cache_get
function (https://github.com/metwork-framework/mfext/blob/master/adm/bash_utils.sh#L74) will execute the command:
find /home/<module>/tmp/ini_to_env_<module>.cache -type f -mmin -1440 -newer /etc/metwork.config.d/<module>/config.ini
So the file ini_to_env_<module>.cache
must
/etc/metwork.config.d/<module>/config.ini
to be taken into account.
It appears some teams (I'm part of it) extract the config files (under /etc/metwork.config.d) using archives (.tar, .tar.gz, .zip) or rpm. It's a good way to extract many file in a raw. It avoids multiplicating the operations for the operator.
But while extracting the archive or rpm, the modification date of the files is kept ! so metwork can consider the cache ini_to_env_<module>.cache
is newer than the config file !
Consider using option -m --touch
while using the commande tar
for extracting file.
Today during a move into production, we face an issue caused by the
tmp/ini_to_env_<module>.cache
which seems to not being refreshed when the config file (/etc/metwork.config.d/<module>/config.ini
) is updated while the module is stopped.So, our environement variables were not up to date.