forked from TrueCloudLab/frostfs-node
[#873] innerring: Use multihanders in the New epoch timer
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>support/v0.27
parent
4afccab015
commit
6638f7d9e6
|
@ -777,7 +777,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
|
|||
// initialize epoch timers
|
||||
server.epochTimer = newEpochTimer(&epochTimerArgs{
|
||||
l: server.log,
|
||||
nm: server.netmapProcessor,
|
||||
newEpochHandlers: server.newEpochHandlers(log),
|
||||
cnrWrapper: cnrClient,
|
||||
epoch: server,
|
||||
epochDuration: globalConfig.EpochDuration,
|
||||
|
@ -805,25 +805,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
|
|||
|
||||
server.addBlockTimer(emissionTimer)
|
||||
|
||||
// initialize notary timers
|
||||
if !server.mainNotaryConfig.disabled {
|
||||
mainNotaryTimer := newNotaryDepositTimer(¬aryDepositArgs{
|
||||
l: log,
|
||||
depositor: server.depositMainNotary,
|
||||
})
|
||||
|
||||
server.addBlockTimer(mainNotaryTimer)
|
||||
}
|
||||
|
||||
if !server.sideNotaryConfig.disabled {
|
||||
sideNotaryTimer := newNotaryDepositTimer(¬aryDepositArgs{
|
||||
l: log,
|
||||
depositor: server.depositSideNotary,
|
||||
})
|
||||
|
||||
server.addBlockTimer(sideNotaryTimer)
|
||||
}
|
||||
|
||||
controlSvcEndpoint := cfg.GetString("control.grpc.endpoint")
|
||||
if controlSvcEndpoint != "" {
|
||||
authKeysStr := cfg.GetStringSlice("control.authorized_keys")
|
||||
|
@ -1039,3 +1020,31 @@ func (s *Server) onlyAlphabetEventHandler(f event.Handler) event.Handler {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) newEpochHandlers(log *zap.Logger) []newEpochHandler {
|
||||
newEpochHandlers := []newEpochHandler{
|
||||
func() {
|
||||
s.netmapProcessor.HandleNewEpochTick(timerEvent.NewEpochTick{})
|
||||
},
|
||||
}
|
||||
|
||||
if !s.mainNotaryConfig.disabled {
|
||||
newEpochHandlers = append(newEpochHandlers,
|
||||
newNotaryDepositHandler(¬aryDepositArgs{
|
||||
l: log,
|
||||
depositor: s.depositMainNotary,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
if !s.sideNotaryConfig.disabled {
|
||||
newEpochHandlers = append(newEpochHandlers,
|
||||
newNotaryDepositHandler(¬aryDepositArgs{
|
||||
l: log,
|
||||
depositor: s.depositSideNotary,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
return newEpochHandlers
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue