From 288437fb99eec4544bbcbfe107d5857ca798516c Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 26 Sep 2023 11:36:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=80=E7=9B=98?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E4=BC=9A=E8=87=AA=E5=B7=B1=E5=94=A4=E9=86=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 减小 timer 的睡眠间隔,进行多次睡眠 --- src/timer.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/timer.ts b/src/timer.ts index ab90202..a9a326b 100644 --- a/src/timer.ts +++ b/src/timer.ts @@ -2,14 +2,14 @@ import Configuration from './configuration'; class Timer { async await() { - // 工作日工作时间 9:00-11.30 13:00-15:00 - if (this.isWorkDay() && this.isWorkTime()) { - return await this.sleep(Configuration.getUpdateInterval()); - } + while (true) { + await this.sleep(Configuration.getUpdateInterval()); - // 周末一直是睡眠 - await this.sleep(60 * 60 * 1000); - await this.await(); + // 工作日工作时间 9:00-11.30 13:00-15:00 + if (this.isWorkDay() && this.isWorkTime()) { + return true + } + } } /**