Dispatch Service Fix maintenance issues (#11973)

If daily.sh exited with non-zero it would kill the maintenance thread, stopping daily.sh
The maintenance lock was never released, this wouldn't cause an issue in normal operation as it should expire.
This commit is contained in:
Tony Murray
2020-07-29 23:12:13 -05:00
committed by GitHub
parent a4f5af069c
commit 38cfab612b

View File

@@ -429,8 +429,13 @@ class Service:
sleep(wait)
info("Running maintenance tasks")
output = LibreNMS.call_script('daily.sh')
info("Maintenance tasks complete\n{}".format(output))
try:
output = LibreNMS.call_script('daily.sh')
info("Maintenance tasks complete\n{}".format(output))
except subprocess.CalledProcessError as e:
error("Error in daily.sh:\n" + (e.output.decode() if e.output is not None else 'No output'))
self._lm.unlock('schema-update', self.config.unique_name)
self.restart()