add debug info

This commit is contained in:
Antonio J. Delgado 2025-03-27 10:46:27 +02:00
parent ef7d748a5f
commit 7107182d52

View file

@ -302,11 +302,23 @@ class BackupImap:
'last_update' in cached_data and
cached_data['last_update'] + self.config['max_cache_age'] > time.time()
):
self._log.debug(
"Cache file '%s' is too old, initializing cache data.",
self.config['cache_file']
)
cached_data = self._default_data
except json.decoder.JSONDecodeError:
self._log.debug(
"Cache file '%s' doesn't contain valid JSON, initializing cache data.",
self.config['cache_file']
)
cached_data = self._default_data
return cached_data
else:
self._log.debug(
"Cache file '%s' doesn't exist, initializing cache data.",
self.config['cache_file']
)
return self._default_data
def _save_cached_data(self, data):