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 <noreply@anthropic.com>
This commit is contained in:
1 parent
1b64fed427
commit
0c5946eb06
1 file changed
+4
-2
@@ -16,6 +16,8 @@ const BATCH = 20
|
|||||||
const IDLE_MS = 60_000
|
const IDLE_MS = 60_000
|
||||||
/** Unmatched spots are matched again this often (the header pass may have built their releases since). */
|
/** Unmatched spots are matched again this often (the header pass may have built their releases since). */
|
||||||
const REMATCH_MS = 60 * 60 * 1000
|
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. */
|
/** Unmatched spots are matched again for this long after their inspection. */
|
||||||
const REMATCH_DAYS = 30
|
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. */
|
/** 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(
|
const { rows: spots } = await db.rawQuery(
|
||||||
`SELECT message_id, inspected_at, release_id FROM spots
|
`SELECT message_id, inspected_at, release_id FROM spots
|
||||||
WHERE status = 'inspected' AND matched = 0 AND inspected_at > now() - make_interval(days => ?)
|
WHERE status = 'inspected' AND matched = 0 AND inspected_at > now() - make_interval(days => ?)
|
||||||
ORDER BY coalesce(rematched_at, inspected_at) LIMIT 500`,
|
ORDER BY coalesce(rematched_at, inspected_at) LIMIT ?`,
|
||||||
[REMATCH_DAYS]
|
[REMATCH_DAYS, REMATCH_BATCH]
|
||||||
)
|
)
|
||||||
const cutoff = Date.now() - coordinatorConfig.spots.standaloneAfterHours * 3600 * 1000
|
const cutoff = Date.now() - coordinatorConfig.spots.standaloneAfterHours * 3600 * 1000
|
||||||
for (const spot of spots) {
|
for (const spot of spots) {
|
||||||
|
|||||||
Reference in new issue
Block a user