forked from TrueCloudLab/frostfs-node
[#168] node: Refactor netmap service init
Resolve funlen linter for initNetmapService function Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
dd572825c7
commit
1f929fdd57
1 changed files with 4 additions and 1 deletions
|
@ -135,7 +135,6 @@ func (c *cfg) addressNum() int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint: funlen
|
|
||||||
func initNetmapService(c *cfg) {
|
func initNetmapService(c *cfg) {
|
||||||
network.WriteToNodeInfo(c.localAddr, &c.cfgNodeInfo.localInfo)
|
network.WriteToNodeInfo(c.localAddr, &c.cfgNodeInfo.localInfo)
|
||||||
c.cfgNodeInfo.localInfo.SetPublicKey(c.key.PublicKey().Bytes())
|
c.cfgNodeInfo.localInfo.SetPublicKey(c.key.PublicKey().Bytes())
|
||||||
|
@ -173,6 +172,10 @@ func initNetmapService(c *cfg) {
|
||||||
netmapGRPC.RegisterNetmapServiceServer(srv, server)
|
netmapGRPC.RegisterNetmapServiceServer(srv, server)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addNewEpochNotificationHandlers(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func addNewEpochNotificationHandlers(c *cfg) {
|
||||||
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
||||||
c.cfgNetmap.state.setCurrentEpoch(ev.(netmapEvent.NewEpoch).EpochNumber())
|
c.cfgNetmap.state.setCurrentEpoch(ev.(netmapEvent.NewEpoch).EpochNumber())
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue