mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 16:00:24 +08:00 
			
		
		
		
	聚合服务相关日志
This commit is contained in:
		@@ -5,6 +5,7 @@ import (
 | 
				
			|||||||
	"github.com/TeaOSLab/EdgeAPI/internal/db/models"
 | 
						"github.com/TeaOSLab/EdgeAPI/internal/db/models"
 | 
				
			||||||
	rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
 | 
						rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
 | 
				
			||||||
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
						"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
				
			||||||
 | 
						"github.com/iwind/TeaGo/lists"
 | 
				
			||||||
	"github.com/iwind/TeaGo/types"
 | 
						"github.com/iwind/TeaGo/types"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -61,8 +62,18 @@ func (this *NodeLogService) ListNodeLogs(ctx context.Context, req *pb.ListNodeLo
 | 
				
			|||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						hashList := []string{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result := []*pb.NodeLog{}
 | 
						result := []*pb.NodeLog{}
 | 
				
			||||||
	for _, log := range logs {
 | 
						for _, log := range logs {
 | 
				
			||||||
 | 
							// 如果是需要修复的日志,我们需要去重
 | 
				
			||||||
 | 
							if req.FixedState > 0 {
 | 
				
			||||||
 | 
								if lists.ContainsString(hashList, log.Hash) {
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								hashList = append(hashList, log.Hash)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		result = append(result, &pb.NodeLog{
 | 
							result = append(result, &pb.NodeLog{
 | 
				
			||||||
			Id:          int64(log.Id),
 | 
								Id:          int64(log.Id),
 | 
				
			||||||
			Role:        log.Role,
 | 
								Role:        log.Role,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user