[scraper] update seeders from trackers directly

This commit is contained in:
TheBeastLT
2021-02-07 18:42:21 +01:00
parent 63ffa653a5
commit fd2f3cc5b7
5 changed files with 47 additions and 62 deletions

View File

@@ -183,14 +183,14 @@ function getTorrentsWithoutSize() {
});
}
function getUpdateSeedersTorrents() {
function getUpdateSeedersTorrents(limit = 100) {
const until = moment().subtract(7, 'days').format('YYYY-MM-DD');
return Torrent.findAll({
where: literal(`torrent."updatedAt" < \'${until}\'`),
limit: 100,
limit: limit,
order: [
['seeders', 'DESC'],
['uploadDate', 'DESC']
['updatedAt', 'ASC']
]
});
}