From 8961313ee1592b2267050792d560f4a9ffe42f31 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Tue, 17 Dec 2019 17:27:15 +0800 Subject: [PATCH] init --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 5f78f2d..c84b8a9 100644 --- a/main.go +++ b/main.go @@ -77,13 +77,14 @@ func tailFile() { ticker := time.NewTicker(1 * time.Minute) for { <-ticker.C - if buffer.Len() > 0 && times > 2 { + //if buffer.Len() > 0 && times > 2 { + if buffer.Len() > 0 { sendMsg(buffer.String()) buffer.Reset() } - buffer.Reset() - times = 0 + //buffer.Reset() + //times = 0 } }() @@ -97,7 +98,7 @@ func tailFile() { for _, key := range keys { if ok, _ := regexp.Match(strings.TrimSpace(key), []byte(text)); ok { //if limiter.IsAvailable() { - // sendMsg(line.Text) + // sendMsg("- " + line.Text + "\n") //} else { // log.Error("dingTalk 1 m allow send 20 msg. msg %v discarded.", // line.Text)