1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-01 23:57:05 +00:00

make reading of previous status check result more robust

This commit is contained in:
KiekerJan 2024-01-03 18:02:34 +01:00
parent 7646095b94
commit 14db287766

View File

@ -965,7 +965,11 @@ def run_and_output_changes(env, pool):
cache_fn = "/var/cache/mailinabox/status_checks.json"
if os.path.exists(cache_fn):
with open(cache_fn, 'r') as f:
prev = json.load(f)
try:
prev = json.load(f)
except json.JSONDecodeError:
logging.debug('Could not decode previous status checks JSON file')
prev = []
# Group the serial output into categories by the headings.
def group_by_heading(lines):