mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-08 03:00:27 +08:00
将RPC连接错误级别从error改为warning
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/iwind/TeaGo/logs"
|
"github.com/iwind/TeaGo/logs"
|
||||||
"github.com/iwind/TeaGo/maps"
|
"github.com/iwind/TeaGo/maps"
|
||||||
"github.com/iwind/TeaGo/types"
|
"github.com/iwind/TeaGo/types"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -75,12 +76,18 @@ func Warn(tag string, description string) {
|
|||||||
func Error(tag string, description string) {
|
func Error(tag string, description string) {
|
||||||
logs.Println("[" + tag + "]" + description)
|
logs.Println("[" + tag + "]" + description)
|
||||||
|
|
||||||
|
// 忽略RPC连接错误
|
||||||
|
var level = "error"
|
||||||
|
if strings.Contains(description, "code = Unavailable desc = connection closed") {
|
||||||
|
level = "warning"
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case logChan <- &pb.NodeLog{
|
case logChan <- &pb.NodeLog{
|
||||||
Role: teaconst.Role,
|
Role: teaconst.Role,
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
Description: description,
|
Description: description,
|
||||||
Level: "error",
|
Level: level,
|
||||||
NodeId: teaconst.NodeId,
|
NodeId: teaconst.NodeId,
|
||||||
CreatedAt: time.Now().Unix(),
|
CreatedAt: time.Now().Unix(),
|
||||||
}:
|
}:
|
||||||
|
|||||||
Reference in New Issue
Block a user