We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e5538d commit cb52efbCopy full SHA for cb52efb
scripts/cleanup_vespa_db.py
@@ -19,14 +19,14 @@ def cleanup_stale_cache():
19
vespa = get_vespa_app()
20
21
while True:
22
- stale_files = EmbeddedFile.objects.prefetch_related(
+ stale_qs = EmbeddedFile.objects.prefetch_related(
23
"embeddings_references"
24
).filter(
25
updated_at__lt=timezone.now() - timedelta(days=STALENESS_THRESHOLD_DAYS)
26
- )[:BATCH_SIZE]
+ ).order_by("updated_at")[:BATCH_SIZE]
27
+ stale_files = list(stale_qs)
28
if not stale_files:
29
break
-
30
docs_to_delete = (
31
{"id": ref.vespa_doc_id}
32
for ef in stale_files
0 commit comments