diff --git a/pool/pool.go b/pool/pool.go index a428e219..b1bf97f1 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -262,6 +262,10 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) { return nil, fmt.Errorf("couldn't create cache: %w", err) } + if options.SessionExpirationDuration == 0 { + options.SessionExpirationDuration = DefaultSessionTokenExpirationDuration + } + ownerID := owner.NewIDFromPublicKey(&options.Key.PublicKey) 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") } - if options.SessionExpirationDuration == 0 { - options.SessionExpirationDuration = DefaultSessionTokenExpirationDuration - } - ctx, cancel := context.WithCancel(ctx) pool := &pool{ innerPools: inner,