[#130] pool: Add default session token duration

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2022-02-02 16:45:01 +03:00 committed by Angira Kekteeva
parent bfff21965d
commit b6abb02ace

View file

@ -254,6 +254,8 @@ type innerPool struct {
clientPacks []*clientPack
}
const DefaultSessionTokenExpirationDuration = 100 // in blocks
func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
cache, err := NewCache()
if err != nil {
@ -301,6 +303,10 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
return nil, fmt.Errorf("at least one node must be healthy")
}
if options.SessionExpirationDuration == 0 {
options.SessionExpirationDuration = DefaultSessionTokenExpirationDuration
}
ctx, cancel := context.WithCancel(ctx)
pool := &pool{
innerPools: inner,