DNS节点可以自动升级

This commit is contained in:
GoEdgeLab
2021-07-22 18:42:57 +08:00
parent 90da95a285
commit 40a3a0f66d
15 changed files with 96 additions and 47 deletions

View File

@@ -6,16 +6,16 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
// 互斥锁管理
// SysLockerService 互斥锁管理
type SysLockerService struct {
BaseService
}
// 获得锁
// SysLockerLock 获得锁
func (this *SysLockerService) SysLockerLock(ctx context.Context, req *pb.SysLockerLockRequest) (*pb.SysLockerLockResponse, error) {
_, userId, err := this.ValidateAdminAndUser(ctx, 0, 0)
if err != nil {
_, err = this.ValidateMonitor(ctx)
_, err = this.ValidateMonitorNode(ctx)
if err != nil {
return nil, err
}
@@ -41,11 +41,11 @@ func (this *SysLockerService) SysLockerLock(ctx context.Context, req *pb.SysLock
return &pb.SysLockerLockResponse{Ok: ok}, nil
}
// 释放锁
// SysLockerUnlock 释放锁
func (this *SysLockerService) SysLockerUnlock(ctx context.Context, req *pb.SysLockerUnlockRequest) (*pb.RPCSuccess, error) {
_, userId, err := this.ValidateAdminAndUser(ctx, 0, 0)
if err != nil {
_, err = this.ValidateMonitor(ctx)
_, err = this.ValidateMonitorNode(ctx)
if err != nil {
return nil, err
}