[BUG] The environment variable 'DELAY' is not available the first time a perodic module is run
Adler6907 opened this issue · comments
Adler6907 commented
During the first run of a periodic module, the environment variable 'DELAY' cannot be retrieved with s.getEnvironmentVariable("DELAY")
.
The problem lies in 'periodic.sh'. The variable is described there after the module is called for the first time.
incorrect:
while :
do
activate_python_venv
python3 "${ALLSKY_SCRIPTS}/flow-runner.py" --event periodic
deactivate_python_venv
DELAY=$(jq ".periodictimer" "${ALLSKY_MODULES}/module-settings.json")
....
correct:
while :
do
DELAY=$(jq ".periodictimer" "${ALLSKY_MODULES}/module-settings.json")
activate_python_venv
python3 "${ALLSKY_SCRIPTS}/flow-runner.py" --event periodic
deactivate_python_venv
....
Alex commented
Thanks, I'll change it so the variable is available before the first periodic flow is run
Alex commented
This has been done and added to the next release