[#130] pool: Set default session token lifetime before initial requests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
b6abb02ace
commit
ac66db59e0
1 changed files with 4 additions and 4 deletions
|
@ -262,6 +262,10 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
|
||||||
return nil, fmt.Errorf("couldn't create cache: %w", err)
|
return nil, fmt.Errorf("couldn't create cache: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.SessionExpirationDuration == 0 {
|
||||||
|
options.SessionExpirationDuration = DefaultSessionTokenExpirationDuration
|
||||||
|
}
|
||||||
|
|
||||||
ownerID := owner.NewIDFromPublicKey(&options.Key.PublicKey)
|
ownerID := owner.NewIDFromPublicKey(&options.Key.PublicKey)
|
||||||
|
|
||||||
inner := make([]*innerPool, len(options.nodesParams))
|
inner := make([]*innerPool, len(options.nodesParams))
|
||||||
|
@ -303,10 +307,6 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
|
||||||
return nil, fmt.Errorf("at least one node must be healthy")
|
return nil, fmt.Errorf("at least one node must be healthy")
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.SessionExpirationDuration == 0 {
|
|
||||||
options.SessionExpirationDuration = DefaultSessionTokenExpirationDuration
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(ctx)
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
pool := &pool{
|
pool := &pool{
|
||||||
innerPools: inner,
|
innerPools: inner,
|
||||||
|
|
Loading…
Reference in a new issue