forked from TrueCloudLab/frostfs-node
[#378] cmd/node: Subscribe shards on new epoch events
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
dab45050b9
commit
b961570766
1 changed files with 10 additions and 0 deletions
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container/wrapper"
|
||||
nmwrapper "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
netmap2 "github.com/nspcc-dev/neofs-node/pkg/morph/event/netmap"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/control"
|
||||
tokenStorage "github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
|
||||
|
@ -611,6 +612,15 @@ func initShardOptions(c *cfg) {
|
|||
|
||||
return pool
|
||||
}),
|
||||
shard.WithGCEventChannelInitializer(func() <-chan shard.Event {
|
||||
ch := make(chan shard.Event)
|
||||
|
||||
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
||||
ch <- shard.EventNewEpoch(ev.(netmap2.NewEpoch).EpochNumber())
|
||||
})
|
||||
|
||||
return ch
|
||||
}),
|
||||
})
|
||||
|
||||
c.log.Info("storage shard options",
|
||||
|
|
Loading…
Reference in a new issue