chore: [management] - fix golint

This commit is contained in:
braginini 2022-01-01 14:53:49 +01:00
parent 09eeb71af2
commit ab579f5de0
2 changed files with 11 additions and 6 deletions

View File

@ -163,6 +163,9 @@ func (s *Server) schedulePeerUpdates(context context.Context, peerKey string, pe
update := toSyncResponse(s.config, peer, peers, nil) update := toSyncResponse(s.config, peer, peers, nil)
err = s.peersUpdateManager.SendUpdate(peerKey, &UpdateMessage{Update: update}) err = s.peersUpdateManager.SendUpdate(peerKey, &UpdateMessage{Update: update})
if err != nil {
continue
}
} }
} }
}() }()

View File

@ -1,6 +1,7 @@
package server package server
import ( import (
"github.com/wiretrustee/wiretrustee/management/proto"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"net" "net"
@ -122,7 +123,8 @@ func (am *AccountManager) DeletePeer(accountId string, peerKey string) (*Peer, e
return nil, err return nil, err
} }
/*err = am.peersUpdateManager.SendUpdate(peerKey, // notify peer itself
err = am.peersUpdateManager.SendUpdate(peerKey,
&UpdateMessage{ &UpdateMessage{
Update: &proto.SyncResponse{ Update: &proto.SyncResponse{
RemotePeers: []*proto.RemotePeerConfig{}, RemotePeers: []*proto.RemotePeerConfig{},
@ -130,10 +132,10 @@ func (am *AccountManager) DeletePeer(accountId string, peerKey string) (*Peer, e
}}) }})
if err != nil { if err != nil {
return nil, err return nil, err
}*/ }
//notify other peers of the change //notify other peers of the change
peers, err := am.Store.GetAccountPeers(accountId) /*peers, err := am.Store.GetAccountPeers(accountId)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -145,7 +147,7 @@ func (am *AccountManager) DeletePeer(accountId string, peerKey string) (*Peer, e
peersToSend = append(peersToSend, remote) peersToSend = append(peersToSend, remote)
} }
} }
/*update := toRemotePeerConfig(peersToSend) update := toRemotePeerConfig(peersToSend)
err = am.peersUpdateManager.SendUpdate(p.Key, err = am.peersUpdateManager.SendUpdate(p.Key,
&UpdateMessage{ &UpdateMessage{
Update: &proto.SyncResponse{ Update: &proto.SyncResponse{
@ -154,8 +156,8 @@ func (am *AccountManager) DeletePeer(accountId string, peerKey string) (*Peer, e
}}) }})
if err != nil { if err != nil {
return nil, err return nil, err
}*/
} }
} */
am.peersUpdateManager.CloseChannel(peerKey) am.peersUpdateManager.CloseChannel(peerKey)
return peer, nil return peer, nil