This commit is contained in:
ehlxr 2019-12-17 17:27:15 +08:00
parent 72e5c0f6ad
commit 8961313ee1

View File

@ -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)