Browse Source

✨ feat: 乐跑10点后提前时间改为随机

Pchen0 1 month ago
parent
commit
c544fc7483
1 changed files with 5 additions and 2 deletions
  1. 5 2
      lib/Lepao/Worker.js

+ 5 - 2
lib/Lepao/Worker.js

@@ -621,8 +621,11 @@ class Worker {
                     throw new Error('当前不在有效乐跑时间范围内。RunForge支持乐跑时间段为7:00~24:00')
 
                 if (hour >= 22) {
-                    this.logger.info(`${req.account}当前时间为${hour}点,调整run_end_time提前5小时`)
-                    run_end_time -= 18000
+                    const minSec = 2 * 60 * 60
+                    const maxSec = 12 * 60 * 60
+                    const advanceSec = Math.floor(Math.random() * (maxSec - minSec + 1)) + minSec
+                    this.logger.info(`${req.account}当前时间为${hour}点,调整run_end_time提前${advanceSec}秒(约${(advanceSec / 3600).toFixed(2)}小时)`)
+                    run_end_time -= advanceSec
                 }
 
                 req = {