Spots: 5,000 unmatched spots matched again an hour
Test and deploy / test (push) Successful in 58s
Test and deploy / edge (push) Successful in 2m21s
Test and deploy / deploy (push) Successful in 1m8s

After a reset every spot is unmatched: 16.5k at 500 an hour took 33 h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-13 18:55:17 +02:00
1 parent 1b64fed427
commit 0c5946eb06
1 file changed
+4 -2
+4 -2
View File
@@ -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) {