Spots: a matched spot's NZB isn't kept
Only a spot that becomes a release of its own needs its NZB (the header pass's releases have their chunks); spots took 2.7 GB on the NVMe at 9k. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96553a5504
commit
1b64fed427
2 files changed
+12
-1
No files matched your search
@@ -283,7 +283,8 @@ export class SpotInspector {
|
|||||||
await trx.from('releases').whereIn('id', [...perRelease.keys()]).update({ passworded: true })
|
await trx.from('releases').whereIn('id', [...perRelease.keys()]).update({ passworded: true })
|
||||||
}
|
}
|
||||||
const top = [...perRelease.entries()].sort((a, b) => b[1] - a[1])[0]
|
const top = [...perRelease.entries()].sort((a, b) => b[1] - a[1])[0]
|
||||||
await trx.from('spots').where('message_id', spotId).update({ matched: fileRelease.size, release_id: top ? top[0] : null })
|
// The NZB is only kept for a release of the spot's own: the header pass's releases have their chunks.
|
||||||
|
await trx.from('spots').where('message_id', spotId).update({ matched: fileRelease.size, release_id: top ? top[0] : null, nzb: null })
|
||||||
})
|
})
|
||||||
return perRelease.size
|
return perRelease.size
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||||
|
|
||||||
|
/** A matched spot's NZB isn't kept (its releases have their chunks): only a spot of its own needs one (2.7 GB at 9k spots). */
|
||||||
|
export default class extends BaseSchema {
|
||||||
|
async up() {
|
||||||
|
this.schema.raw(`UPDATE spots SET nzb = NULL WHERE matched > 0 AND nzb IS NOT NULL`)
|
||||||
|
}
|
||||||
|
|
||||||
|
async down() {}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user