|
@@ -316,8 +316,9 @@ class default_1 {
|
|
|
fs.writeFileSync(path.resolve(this.lockfile), JSON.stringify(lock));
|
|
|
}
|
|
|
});
|
|
|
- utils_1.chainPromises(utils_1.Arr.chunk(lock.feed.slice(0).reverse(), 5).map((arr, i) => () => Promise.all(arr.map((currentFeed, j) => {
|
|
|
- lock.workon = (lock.feed.length - 1) - i * 5 + j;
|
|
|
+ const queuedFeeds = lock.feed.slice(0, lock.workon ? lock.workon + 1 : undefined).reverse();
|
|
|
+ utils_1.chainPromises(utils_1.Arr.chunk(queuedFeeds, 5).map((arr, i) => () => Promise.all(arr.map((currentFeed, j) => {
|
|
|
+ lock.workon = (queuedFeeds.length - 1) - i * 5 + j;
|
|
|
fs.writeFileSync(path.resolve(this.lockfile), JSON.stringify(lock));
|
|
|
const promiseDelay = this.workInterval * (Math.random() + j) * 500 / lock.feed.length;
|
|
|
logger.debug(`timeout for this pull job: ${promiseDelay * 2}`);
|