From 127c57dc3aa4e8e41dfce96be8a811532d50ddf4 Mon Sep 17 00:00:00 2001 From: zhaoyupeng Date: Tue, 15 Jul 2025 11:43:15 +0800 Subject: [PATCH] refactor: rename timeout ctx --- database/cache/new.go | 2 +- tool/ctx.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/cache/new.go b/database/cache/new.go index 8409681..b92b50a 100644 --- a/database/cache/new.go +++ b/database/cache/new.go @@ -45,7 +45,7 @@ func New(opts ...OptionFn) (Cache, error) { 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 } diff --git a/tool/ctx.go b/tool/ctx.go index e5320c1..adfc696 100644 --- a/tool/ctx.go +++ b/tool/ctx.go @@ -23,7 +23,7 @@ func Timeout(seconds ...int) (ctx context.Context) { return } -func CtxTimeout(ctx context.Context, seconds ...int) context.Context { +func TimeoutCtx(ctx context.Context, seconds ...int) context.Context { var ( duration time.Duration )