From 83743955d6af0da07cea4ada19f28d94bd752acf Mon Sep 17 00:00:00 2001 From: lwch Date: Tue, 9 Aug 2022 17:01:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E8=BF=9E=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E9=97=B4=E9=9A=94=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index add02ef..3e44ef9 100644 --- a/app.go +++ b/app.go @@ -60,9 +60,11 @@ func (app *app) start() { go app.a.LoopWrite(app.ctx, app.chWrite) go app.debug(app.ctx) - var nextSleep time.Duration + i := 0 + nextSleep := time.Second for { - if nextSleep > 0 { + i++ + if i > 1 { time.Sleep(nextSleep) nextSleep <<= 1 if nextSleep > 30*time.Second {