瀏覽代碼

输出超长的循环时间

flyzto 1 月之前
父節點
當前提交
3f5be5e1b4
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      pinnacle/main.js

+ 8 - 3
pinnacle/main.js

@@ -447,9 +447,9 @@ const updateInRunning = async () => {
 
 
 const ratioAccept = (ratio) => {
 const ratioAccept = (ratio) => {
   if (ratio > 0) {
   if (ratio > 0) {
-    return 'a'
+    return 'a';
   }
   }
-  return ''
+  return '';
 }
 }
 const ratioString = (ratio) => {
 const ratioString = (ratio) => {
   ratio = Math.abs(ratio);
   ratio = Math.abs(ratio);
@@ -694,7 +694,12 @@ const pinnacleDataLoop = () => {
     const nowTime = Date.now();
     const nowTime = Date.now();
     const loopDuration = nowTime - GLOBAL_DATA.loopResultTime;
     const loopDuration = nowTime - GLOBAL_DATA.loopResultTime;
     GLOBAL_DATA.loopResultTime = nowTime;
     GLOBAL_DATA.loopResultTime = nowTime;
-    Logs.outDev('loop duration', loopDuration);
+    if (loopDuration > 15000) {
+      Logs.out('loop duration is too long', loopDuration);
+    }
+    else {
+      Logs.outDev('loop duration', loopDuration);
+    }
 
 
     const { straightFixturesVersion: sfv, specialFixturesVersion: pfv, straightOddsVersion: sov, specialsOddsVersion: pov } = GLOBAL_DATA;
     const { straightFixturesVersion: sfv, specialFixturesVersion: pfv, straightOddsVersion: sov, specialsOddsVersion: pov } = GLOBAL_DATA;
     const timestamp = Math.max(sfv, pfv, sov, pov);
     const timestamp = Math.max(sfv, pfv, sov, pov);