Browse Source

优化错误处理逻辑

flyzto 1 month ago
parent
commit
a130940187
1 changed files with 3 additions and 3 deletions
  1. 3 3
      pinnacle/main.js

+ 3 - 3
pinnacle/main.js

@@ -626,11 +626,9 @@ const pinnacleDataLoop = () => {
   .then(() => {
     const nowTime = Date.now();
     const loopDuration = nowTime - GLOBAL_DATA.loopResultTime;
+    GLOBAL_DATA.loopResultTime = nowTime;
     Logs.outDev('loop duration', loopDuration);
 
-    GLOBAL_DATA.loopResultTime = nowTime;
-    GLOBAL_DATA.straightFixturesCount++;
-    GLOBAL_DATA.specialFixturesCount++;
     GLOBAL_DATA.requestErrorCount = 0;
 
     const { straightFixturesVersion: sfv, specialFixturesVersion: pfv, straightOddsVersion: sov, specialsOddsVersion: pov } = GLOBAL_DATA;
@@ -654,6 +652,8 @@ const pinnacleDataLoop = () => {
     if (!GLOBAL_DATA.loopActive) {
       return;
     }
+    GLOBAL_DATA.straightFixturesCount++;
+    GLOBAL_DATA.specialFixturesCount++;
     setTimeout(pinnacleDataLoop, 1000 * 5);
   });
 }