Avoid endless loop of stat()
This commit is contained in:
parent
86716e83b4
commit
5136910c56
1 changed files with 4 additions and 4 deletions
|
|
@ -44,14 +44,14 @@ class Thumbnailer(ThreadPoolExecutor):
|
||||||
def generate_thumbnail(self, file_item: FileItem):
|
def generate_thumbnail(self, file_item: FileItem):
|
||||||
"""Schedule thumbnail generation."""
|
"""Schedule thumbnail generation."""
|
||||||
|
|
||||||
if not file_item.full_path.is_file():
|
|
||||||
return
|
|
||||||
|
|
||||||
if file_item.attempted_thumbnail.value:
|
if file_item.attempted_thumbnail.value:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.submit(generate_thumbnail_sync_nicely, file_item)
|
if not file_item.full_path.is_file():
|
||||||
|
return
|
||||||
|
|
||||||
file_item.attempted_thumbnail.value = True
|
file_item.attempted_thumbnail.value = True
|
||||||
|
self.submit(generate_thumbnail_sync_nicely, file_item)
|
||||||
|
|
||||||
|
|
||||||
def generate_thumbnail_sync_nicely(file_item: FileItem):
|
def generate_thumbnail_sync_nicely(file_item: FileItem):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue