mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-21 02:27:15 +02:00
[ui] override default time limit for thumbnails on disk with env var
This commit is contained in:
parent
b372946516
commit
a96d886923
2 changed files with 8 additions and 2 deletions
|
@ -121,6 +121,11 @@ class MeshroomApp(QApplication):
|
||||||
if thumbnailDir is not None:
|
if thumbnailDir is not None:
|
||||||
ThumbnailCache.thumbnailDir = thumbnailDir
|
ThumbnailCache.thumbnailDir = thumbnailDir
|
||||||
|
|
||||||
|
# User specifed time limit for thumbnails on disk (expressed in days)
|
||||||
|
thumbnailTimeLimit = float(os.getenv('MESHROOM_THUMBNAIL_TIME_LIMIT'))
|
||||||
|
if thumbnailTimeLimit is not None:
|
||||||
|
ThumbnailCache.storageTimeLimit = thumbnailTimeLimit
|
||||||
|
|
||||||
# Clean thumbnail directory
|
# Clean thumbnail directory
|
||||||
ThumbnailCache.clean()
|
ThumbnailCache.clean()
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ class ThumbnailCache(QObject):
|
||||||
|
|
||||||
This class also takes care of cleaning the thumbnail directory,
|
This class also takes care of cleaning the thumbnail directory,
|
||||||
i.e. scanning this directory and removing thumbnails that have not been used for too long.
|
i.e. scanning this directory and removing thumbnails that have not been used for too long.
|
||||||
The default time limit is one week.
|
The default time limit is 90 days.
|
||||||
|
This time limit can be overriden with the MESHROOM_THUMBNAIL_TIME_LIMIT environment variable.
|
||||||
|
|
||||||
The main use case for thumbnails in Meshroom is in the ImageGallery.
|
The main use case for thumbnails in Meshroom is in the ImageGallery.
|
||||||
"""
|
"""
|
||||||
|
@ -33,7 +34,7 @@ class ThumbnailCache(QObject):
|
||||||
thumbnailSize = QSize(100, 100)
|
thumbnailSize = QSize(100, 100)
|
||||||
|
|
||||||
# Time limit for thumbnail storage on disk, expressed in days
|
# Time limit for thumbnail storage on disk, expressed in days
|
||||||
storageTimeLimit = 7
|
storageTimeLimit = 90
|
||||||
|
|
||||||
@Slot(QUrl, result=QUrl)
|
@Slot(QUrl, result=QUrl)
|
||||||
def thumbnail(self, imgSource):
|
def thumbnail(self, imgSource):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue