Parcourir la source

fix missing parens

Mike L il y a 3 ans
Parent
commit
e2e763cab1
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      dist/twitter.js
  2. 1 1
      src/twitter.ts

+ 1 - 1
dist/twitter.js

@@ -318,7 +318,7 @@ class default_1 {
             });
             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;
+                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}`);

+ 1 - 1
src/twitter.ts

@@ -496,7 +496,7 @@ export default class {
     const queuedFeeds = lock.feed.slice(0, lock.workon ? lock.workon + 1 : undefined).reverse();
     chainPromises(Arr.chunk(queuedFeeds, 5).map((arr, i) =>
       () => Promise.all(arr.map((currentFeed, j) => {
-        lock.workon = (queuedFeeds.length - 1) - i * 5 + 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;