init
This commit is contained in:
parent
72e5c0f6ad
commit
8961313ee1
9
main.go
9
main.go
@ -77,13 +77,14 @@ func tailFile() {
|
|||||||
ticker := time.NewTicker(1 * time.Minute)
|
ticker := time.NewTicker(1 * time.Minute)
|
||||||
for {
|
for {
|
||||||
<-ticker.C
|
<-ticker.C
|
||||||
if buffer.Len() > 0 && times > 2 {
|
//if buffer.Len() > 0 && times > 2 {
|
||||||
|
if buffer.Len() > 0 {
|
||||||
sendMsg(buffer.String())
|
sendMsg(buffer.String())
|
||||||
buffer.Reset()
|
buffer.Reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.Reset()
|
//buffer.Reset()
|
||||||
times = 0
|
//times = 0
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@ -97,7 +98,7 @@ func tailFile() {
|
|||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
if ok, _ := regexp.Match(strings.TrimSpace(key), []byte(text)); ok {
|
if ok, _ := regexp.Match(strings.TrimSpace(key), []byte(text)); ok {
|
||||||
//if limiter.IsAvailable() {
|
//if limiter.IsAvailable() {
|
||||||
// sendMsg(line.Text)
|
// sendMsg("- " + line.Text + "\n")
|
||||||
//} else {
|
//} else {
|
||||||
// log.Error("dingTalk 1 m allow send 20 msg. msg %v discarded.",
|
// log.Error("dingTalk 1 m allow send 20 msg. msg %v discarded.",
|
||||||
// line.Text)
|
// line.Text)
|
||||||
|
Loading…
Reference in New Issue
Block a user