🐛ants使用了默认连接池不要release,会变得不幸😢
This commit is contained in:
parent
869dedc580
commit
aff875eb11
3
loki.go
3
loki.go
@ -75,7 +75,6 @@ func (c lokiWriter) Write(p []byte) (int, error) {
|
|||||||
label["level"] = model.LabelValue(li.Level)
|
label["level"] = model.LabelValue(li.Level)
|
||||||
label["caller"] = model.LabelValue(li.Caller)
|
label["caller"] = model.LabelValue(li.Caller)
|
||||||
|
|
||||||
// 异步推送消息到服务器
|
|
||||||
_ = ants.Submit(func() {
|
_ = ants.Submit(func() {
|
||||||
t, e := time.ParseInLocation("2006-01-02 15:04:05.000", li.Ts, time.Local)
|
t, e := time.ParseInLocation("2006-01-02 15:04:05.000", li.Ts, time.Local)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
@ -86,8 +85,6 @@ func (c lokiWriter) Write(p []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
defer ants.Release()
|
|
||||||
|
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user