forked from TrueCloudLab/frostfs-node
[#21] ir: Add inner ring list relay processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
f11ae1035d
commit
4aee3de24e
3 changed files with 54 additions and 0 deletions
23
pkg/innerring/processors/neofs/process_update.go
Normal file
23
pkg/innerring/processors/neofs/process_update.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package neofs
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
|
||||
neofsEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/neofs"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Process update inner ring event by setting inner ring list value from
|
||||
// main chain in side chain.
|
||||
func (np *Processor) processUpdateInnerRing(list *neofsEvent.UpdateInnerRing) {
|
||||
if !np.activeState.IsActive() {
|
||||
np.log.Info("passive mode, ignore deposit")
|
||||
return
|
||||
}
|
||||
|
||||
err := invoke.UpdateInnerRing(np.morphClient, np.netmapContract,
|
||||
list.Keys(),
|
||||
)
|
||||
if err != nil {
|
||||
np.log.Error("can't relay update inner ring event", zap.Error(err))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue