forked from TrueCloudLab/frostfs-node
[#873] innerring: Reuse atomic IR's epochDuration instead of RPC call
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
505d92bb06
commit
96a65df32b
4 changed files with 18 additions and 38 deletions
|
@ -10,12 +10,6 @@ import (
|
|||
// Process new epoch notification by setting global epoch value and resetting
|
||||
// local epoch timer.
|
||||
func (np *Processor) processNewEpoch(epoch uint64) {
|
||||
np.epochState.SetEpochCounter(epoch)
|
||||
if err := np.epochTimer.ResetEpochTimer(); err != nil {
|
||||
np.log.Warn("can't reset epoch timer",
|
||||
zap.String("error", err.Error()))
|
||||
}
|
||||
|
||||
epochDuration, err := np.netmapClient.EpochDuration()
|
||||
if err != nil {
|
||||
np.log.Warn("can't get epoch duration",
|
||||
|
@ -24,6 +18,12 @@ func (np *Processor) processNewEpoch(epoch uint64) {
|
|||
np.epochState.SetEpochDuration(epochDuration)
|
||||
}
|
||||
|
||||
np.epochState.SetEpochCounter(epoch)
|
||||
if err := np.epochTimer.ResetEpochTimer(); err != nil {
|
||||
np.log.Warn("can't reset epoch timer",
|
||||
zap.String("error", err.Error()))
|
||||
}
|
||||
|
||||
// get new netmap snapshot
|
||||
networkMap, err := np.netmapClient.Snapshot()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue