优化代码

This commit is contained in:
GoEdgeLab
2021-08-07 16:11:35 +08:00
parent 80a309fb9b
commit c0a67b1358
8 changed files with 14 additions and 23 deletions

View File

@@ -91,6 +91,9 @@ func (this *NSNodeService) ListEnabledNSNodesMatch(ctx context.Context, req *pb.
var tx = this.NullTx()
nodes, err := nameservers.SharedNSNodeDAO.ListAllEnabledNodesMatch(tx, req.NsClusterId, configutils.ToBoolState(req.InstallState), configutils.ToBoolState(req.ActiveState), req.Keyword, req.Offset, req.Size)
if err != nil {
return nil, err
}
pbNodes := []*pb.NSNode{}
for _, node := range nodes {
// 安装信息
@@ -405,6 +408,9 @@ func (this *NSNodeService) DownloadNSNodeInstallationFile(ctx context.Context, r
}
data, offset, err := file.Read(req.ChunkOffset)
if err != nil {
return nil, err
}
return &pb.DownloadNSNodeInstallationFileResponse{
Sum: sum,