[scraper] rework scraper scheduling and added seeders updating

This commit is contained in:
TheBeastLT
2020-04-23 16:33:08 +02:00
parent d01e2c9b35
commit 9ea3932af1
19 changed files with 128 additions and 108 deletions

View File

@@ -24,9 +24,7 @@ async function scrape() {
}
async function updateSeeders(torrent) {
return limiter.schedule(() => yts.torrent(torrent.torrentId)
.then(records => records.map(record => ({ ...record, provider: NAME })))
.then(records => Promise.all(records.map(record => updateTorrentSeeders(record)))));
return limiter.schedule(() => yts.torrent(torrent.torrentId));
}
async function scrapeLatestTorrents() {