mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-02 19:56:46 +02:00
[ui] ThumbnailCache: catch FileNotFoundError when removing thumbnails
This commit is contained in:
parent
7abbf1bbf3
commit
8551135514
1 changed files with 8 additions and 2 deletions
|
@ -200,7 +200,10 @@ class ThumbnailCache(QObject):
|
||||||
# Remove all thumbnails marked as removable
|
# Remove all thumbnails marked as removable
|
||||||
for path in toRemove:
|
for path in toRemove:
|
||||||
logging.debug(f'[ThumbnailCache] Remove {path}')
|
logging.debug(f'[ThumbnailCache] Remove {path}')
|
||||||
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
except FileNotFoundError:
|
||||||
|
logging.error(f'[ThumbnailCache] Tried to remove {path} but this file does not exist')
|
||||||
|
|
||||||
# Check if number of thumbnails on disk exceeds limit
|
# Check if number of thumbnails on disk exceeds limit
|
||||||
if len(remaining) > ThumbnailCache.maxThumbnailsOnDisk:
|
if len(remaining) > ThumbnailCache.maxThumbnailsOnDisk:
|
||||||
|
@ -212,4 +215,7 @@ class ThumbnailCache(QObject):
|
||||||
for i in range(nbToRemove):
|
for i in range(nbToRemove):
|
||||||
path = remaining[i][0]
|
path = remaining[i][0]
|
||||||
logging.debug(f'[ThumbnailCache] Remove {path}')
|
logging.debug(f'[ThumbnailCache] Remove {path}')
|
||||||
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
except FileNotFoundError:
|
||||||
|
logging.error(f'[ThumbnailCache] Tried to remove {path} but this file does not exist')
|
||||||
|
|
Loading…
Add table
Reference in a new issue