fix embeddings reindex

- always increment processed objects to prevent division by zero
- ensure description still gets processed even if there is no thumbnail
This commit is contained in:
Josh Hawkins 2025-07-13 06:56:50 -05:00
parent d574d1edae
commit 2495e4d7c3

View File

@ -339,6 +339,12 @@ class Embeddings:
batch_thumbs = {}
batch_descs = {}
for event in events:
totals["processed_objects"] += 1
if description := event.data.get("description", "").strip():
batch_descs[event.id] = description
totals["descriptions"] += 1
thumbnail = get_event_thumbnail_bytes(event)
if thumbnail is None:
@ -347,12 +353,6 @@ class Embeddings:
batch_thumbs[event.id] = thumbnail
totals["thumbnails"] += 1
if description := event.data.get("description", "").strip():
batch_descs[event.id] = description
totals["descriptions"] += 1
totals["processed_objects"] += 1
# run batch embedding
self.batch_embed_thumbnail(batch_thumbs)