[addon] moves limiter to database retrieve method

This commit is contained in:
TheBeastLT
2020-05-24 10:23:16 +02:00
parent 17a708d839
commit ee9491c4fa

View File

@@ -26,7 +26,7 @@ builder.defineStreamHandler((args) => {
return Promise.resolve({ streams: [] });
}
return limiter.schedule(() => cacheWrapStream(args.id, () => streamHandler(args)
return cacheWrapStream(args.id, () => limiter.schedule(() => streamHandler(args)
.then(records => records
.sort((a, b) => b.torrent.seeders - a.torrent.seeders || b.torrent.uploadDate - a.torrent.uploadDate)
.map(record => toStreamInfo(record)))))