Explorar o código

fix pair process

zhangchunrui hai 1 mes
pai
achega
1d7f62fd3f
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      index.mjs

+ 1 - 2
index.mjs

@@ -291,7 +291,6 @@ async function processTradePair() {
 
   console.log(`其中 ${unsentTradePair.length} 个未发送过`)
   if (!firstRun) {
-    firstRun = false
     // 发送到 Discord
     for (const pair of unsentTradePair) {
       const success = await sendToDiscordTradePair(pair)
@@ -301,9 +300,9 @@ async function processTradePair() {
       // 避免发送过快,稍微延迟
       await new Promise((resolve) => setTimeout(resolve, 500))
     }
-  
     console.log(`处理完成,已发送 ${unsentTradePair.length} 个交易对`)
   } else {
+    firstRun = false
     console.log('第一次运行,不发送交易对')
   }
 }