diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-07-21 22:12:04 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-07-21 22:14:07 +0200 |
commit | 59fa3bb120a36c231579eab757b6e54ff62c51b7 (patch) | |
tree | 2f30c4c96c195fc93b766d0d82594dbf84abaa84 /src/live/ogOperations.py | |
parent | fcfa5f9fbc3b955d746416e30804b19979164ffb (diff) |
live: improve logging for file removal from cache
Provide a bit more logging to make it easier to debug issues.
Diffstat (limited to 'src/live/ogOperations.py')
-rw-r--r-- | src/live/ogOperations.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index 5417a7c..44d8f1b 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -610,12 +610,16 @@ class OgLiveOperations: images = request.getImages() deleted_images = [] + logging.info(f'Request to remove files from cache') + if not mount_cache(): + logging.error(f'Cache is not mounted') return img_dir = OG_CACHE_IMAGE_PATH if not os.path.isdir(img_dir): + logging.error(f'{img_dir} is not a directory') return cache_contents for file_name in os.listdir(img_dir): @@ -630,20 +634,22 @@ class OgLiveOperations: continue if file_name in images: + logging.info(f'Removing file {file_path} from cache') os.remove(file_path) csum_path = file_path + '.full.sum' if not os.path.isfile(csum_path): - logging.info(f'Missing checksum file for {file_path}') + logging.info(f'Missing checksum file {csum_path}') continue + logging.info(f'Removing checksum file {csum_path} from cache') os.remove(csum_path) result = {'cache': self._get_cache_contents()} self._restartBrowser(self._url) - logging.info('Sending response to cache/delete request') + logging.info('Delete file from cache request OK') return result def refresh(self, ogRest): |