mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] use mem cache for resolved links
This commit is contained in:
@@ -52,7 +52,7 @@ const MOCHS = {
|
||||
|
||||
const unrestrictQueue = new namedQueue((task, callback) => task.method()
|
||||
.then(result => callback(false, result))
|
||||
.catch((error => callback(error))));
|
||||
.catch((error => callback(error))), 5);
|
||||
|
||||
async function applyMochs(streams, config) {
|
||||
if (!streams || !streams.length || !Object.keys(MOCHS).find(moch => config[moch])) {
|
||||
@@ -92,7 +92,7 @@ async function resolve(parameters) {
|
||||
console.warn(error);
|
||||
return StaticResponse.FAILED_UNEXPECTED;
|
||||
});
|
||||
|
||||
console.log(`Starting [${parameters.infoHash}] link resolve with queue size: ${unrestrictQueue.length()}`);
|
||||
return new Promise(((resolve, reject) => {
|
||||
unrestrictQueue.push({ id, method }, (error, result) => result ? resolve(result) : reject(error));
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user