mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
reduce rd timeout and increase concurrency
This commit is contained in:
@@ -17,7 +17,7 @@ const STALE_ERROR_AGE = 7 * 24 * 60 * 60; // 7 days
|
|||||||
|
|
||||||
const builder = new addonBuilder(dummyManifest());
|
const builder = new addonBuilder(dummyManifest());
|
||||||
const limiter = new Bottleneck({
|
const limiter = new Bottleneck({
|
||||||
maxConcurrent: process.env.LIMIT_MAX_CONCURRENT || 30,
|
maxConcurrent: process.env.LIMIT_MAX_CONCURRENT || 50,
|
||||||
highWater: process.env.LIMIT_QUEUE_SIZE || 50,
|
highWater: process.env.LIMIT_QUEUE_SIZE || 50,
|
||||||
strategy: Bottleneck.strategy.OVERFLOW
|
strategy: Bottleneck.strategy.OVERFLOW
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ Object.values(MochOptions)
|
|||||||
.map(moch => moch.key)
|
.map(moch => moch.key)
|
||||||
.forEach(mochKey => unrestrictQueues[mochKey] = new namedQueue((task, callback) => task.method()
|
.forEach(mochKey => unrestrictQueues[mochKey] = new namedQueue((task, callback) => task.method()
|
||||||
.then(result => callback(false, result))
|
.then(result => callback(false, result))
|
||||||
.catch((error => callback(error))), 20));
|
.catch((error => callback(error))), 40));
|
||||||
|
|
||||||
export function hasMochConfigured(config) {
|
export function hasMochConfigured(config) {
|
||||||
return Object.keys(MochOptions).find(moch => config?.[moch])
|
return Object.keys(MochOptions).find(moch => config?.[moch])
|
||||||
|
|||||||
@@ -395,5 +395,5 @@ function infringingFile(error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getDefaultOptions(ip) {
|
async function getDefaultOptions(ip) {
|
||||||
return { ip, timeout: 10000 };
|
return { ip, timeout: 5000 };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user