forked from TrueCloudLab/frostfs-node
[#134] Resend bootstrap txs periodically
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
c7975dbe87
commit
2bd827a478
2 changed files with 27 additions and 3 deletions
|
@ -58,6 +58,19 @@ func initNetmapService(c *cfg) {
|
|||
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
||||
c.cfgNetmap.state.setCurrentEpoch(ev.(netmapEvent.NewEpoch).EpochNumber())
|
||||
})
|
||||
|
||||
if c.cfgNetmap.reBootstrapEnabled {
|
||||
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
||||
n := ev.(netmapEvent.NewEpoch).EpochNumber()
|
||||
|
||||
if n%c.cfgNetmap.reBootstrapInterval == 0 {
|
||||
err := c.cfgNetmap.wrapper.AddPeer(c.cfgNodeInfo.info)
|
||||
if err != nil {
|
||||
c.log.Warn("can't send re-bootstrap tx", zap.Error(err))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func bootstrapNode(c *cfg) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue