Quellcode durchsuchen

优化错误处理逻辑

flyzto vor 1 Monat
Ursprung
Commit
a130940187
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  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);
   });
 }