某个服务端口启动失败后,会自动重试

This commit is contained in:
刘祥超
2021-06-06 13:40:00 +08:00
parent aeb1bc08a7
commit 0df5dfad23
3 changed files with 74 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ func Error(tag string, description string) {
}
}
// ServerError 打印错误信息
// ServerError 打印服务相关错误信息
func ServerError(serverId int64, tag string, description string) {
logs.Println("[" + tag + "]" + description)
@@ -117,6 +117,30 @@ func ServerError(serverId int64, tag string, description string) {
}
}
// ServerSuccess 打印服务相关成功信息
func ServerSuccess(serverId int64, tag string, description string) {
logs.Println("[" + tag + "]" + description)
nodeConfig, _ := nodeconfigs.SharedNodeConfig()
if nodeConfig == nil {
return
}
select {
case logChan <- &pb.NodeLog{
Role: teaconst.Role,
Tag: tag,
Description: description,
Level: "success",
NodeId: nodeConfig.Id,
ServerId: serverId,
CreatedAt: time.Now().Unix(),
}:
default:
}
}
// 上传日志
func uploadLogs() error {
logList := []*pb.NodeLog{}