From 0c5946eb0698a30602ddf4a870da793ab5b2afe5 Mon Sep 17 00:00:00 2001 From: Daan Meijer Date: Tue, 13 Oct 2026 18:55:17 +0200 Subject: [PATCH] Spots: 5,000 unmatched spots matched again an hour After a reset every spot is unmatched: 16.5k at 500 an hour took 33 h. Co-Authored-By: Claude Opus 5.5 --- app/services/spot_inspector.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/spot_inspector.ts b/app/services/spot_inspector.ts index 5c607c8..c72569c 100644 --- a/app/services/spot_inspector.ts +++ b/app/services/spot_inspector.ts @@ -16,6 +16,8 @@ const BATCH = 20 const IDLE_MS = 60_000 /** Unmatched spots are matched again this often (the header pass may have built their releases since). */ const REMATCH_MS = 60 * 60 * 1000 +/** Unmatched spots matched again per hour: after a reset every spot is (16.5k at 500 an hour took 33 h). */ +const REMATCH_BATCH = 5000 /** Unmatched spots are matched again for this long after their inspection. */ const REMATCH_DAYS = 30 /** A file's release posted further apart than this from the NZB's date is another upload of the same name. */ @@ -295,8 +297,8 @@ export class SpotInspector { const { rows: spots } = await db.rawQuery( `SELECT message_id, inspected_at, release_id FROM spots WHERE status = 'inspected' AND matched = 0 AND inspected_at > now() - make_interval(days => ?) - ORDER BY coalesce(rematched_at, inspected_at) LIMIT 500`, - [REMATCH_DAYS] + ORDER BY coalesce(rematched_at, inspected_at) LIMIT ?`, + [REMATCH_DAYS, REMATCH_BATCH] ) const cutoff = Date.now() - coordinatorConfig.spots.standaloneAfterHours * 3600 * 1000 for (const spot of spots) {