add using lazy connect #122
5
redis.go
5
redis.go
@ -56,13 +56,16 @@ var (
|
||||
)
|
||||
|
||||
type Store struct {
|
||||
opts store.Options
|
||||
cli goredis.UniversalClient
|
||||
pool *pool.StringsPool
|
||||
connected *atomic.Bool
|
||||
opts store.Options
|
||||
}
|
||||
|
||||
func (r *Store) Connect(ctx context.Context) error {
|
||||
if r.connected.Load() {
|
||||
return nil
|
||||
}
|
||||
if r.cli == nil {
|
||||
return store.ErrNotConnected
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user