refactor: rename timeout ctx
This commit is contained in:
2
database/cache/new.go
vendored
2
database/cache/new.go
vendored
@ -45,7 +45,7 @@ func New(opts ...OptionFn) (Cache, error) {
|
|||||||
Password: password,
|
Password: password,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err = client.Ping(tool.CtxTimeout(cfg.ctx, 5)).Err(); err != nil {
|
if err = client.Ping(tool.TimeoutCtx(cfg.ctx, 5)).Err(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ func Timeout(seconds ...int) (ctx context.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func CtxTimeout(ctx context.Context, seconds ...int) context.Context {
|
func TimeoutCtx(ctx context.Context, seconds ...int) context.Context {
|
||||||
var (
|
var (
|
||||||
duration time.Duration
|
duration time.Duration
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user