diff --git a/scraper/lib/repository.js b/scraper/lib/repository.js index c1f503f..f643a49 100644 --- a/scraper/lib/repository.js +++ b/scraper/lib/repository.js @@ -182,8 +182,12 @@ function getTorrentsWithoutSize() { function getUpdateSeedersTorrents() { const until = moment().subtract(7, 'days').format('YYYY-MM-DD'); return Torrent.findAll({ - where: literal(`torrent."updatedAt" < \'${until}\' and random() < 0.001`), - limit: 100 + where: literal(`torrent."updatedAt" < \'${until}\'`), + limit: 100, + order: [ + ['seeders', 'DESC'], + ['uploadDate', 'DESC'] + ] }); } diff --git a/scraper/scheduler/seeders.js b/scraper/scheduler/seeders.js index 6ec81fe..9f84aca 100644 --- a/scraper/scheduler/seeders.js +++ b/scraper/scheduler/seeders.js @@ -7,7 +7,7 @@ const { updateTorrentSeeders } = require('../lib/torrentEntries') const DELAY = 15 * 1000; // 15 seconds const limiter = new Bottleneck({ maxConcurrent: 20, minTime: 250 }); -const updateLimiter = new Bottleneck({ maxConcurrent: 20 }); +const updateLimiter = new Bottleneck({ maxConcurrent: 5 }); const forceSeedersLimiter = new Bottleneck({ maxConcurrent: 5 }); const statistics = {};