Improve performance of job status updates through caching hashes

This commit is contained in:
Brett Williams
2023-06-03 16:59:01 -05:00
parent 7dc7f17f83
commit a9257a6bf5
4 changed files with 45 additions and 17 deletions

View File

@@ -32,8 +32,11 @@ def generate_thumbnail_for_job(job, thumb_video_path, thumb_image_path, max_widt
generate_thumbnail(source_path=source, dest_path=thumb_video_path, max_width=max_width)
except Exception as e:
logger.error(f"Error generating thumbnail for {source}: {e}")
finally:
try:
os.remove(in_progress_path)
except FileNotFoundError:
pass
# Determine best source file to use for thumbs
if job.status == RenderStatus.COMPLETED: # use finished file for thumb