forked from TrueCloudLab/frostfs-node
[#1133] services/session: remove expired tokens every epoch
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
b3b3b8b20f
commit
0695ec4125
2 changed files with 17 additions and 0 deletions
|
@ -2,6 +2,8 @@ package main
|
|||
|
||||
import (
|
||||
sessionGRPC "github.com/nspcc-dev/neofs-api-go/v2/session/grpc"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/event/netmap"
|
||||
sessionTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/session/grpc"
|
||||
sessionSvc "github.com/nspcc-dev/neofs-node/pkg/services/session"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
|
||||
|
@ -9,6 +11,9 @@ import (
|
|||
|
||||
func initSessionService(c *cfg) {
|
||||
c.privateTokenStore = storage.New()
|
||||
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
||||
c.privateTokenStore.RemoveOld(ev.(netmap.NewEpoch).EpochNumber())
|
||||
})
|
||||
|
||||
server := sessionTransportGRPC.New(
|
||||
sessionSvc.NewSignService(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue