定时器改版优化

This commit is contained in:
Yun
2025-09-17 19:12:55 +08:00
parent f11fbd1703
commit 4a131290d6
5 changed files with 189 additions and 94 deletions
+2 -2
View File
@@ -20,9 +20,9 @@ func Init(ctx context.Context, redis redis.UniversalClient, opts ...Option) erro
// 新起一个锁对象
// 先Init后New再Lock
func New(ctx context.Context, uniqueKey string) (*globalLock, error) {
func New(ctx context.Context, uniqueKey string) (*GlobalLock, error) {
if redisConn == nil {
return nil, fmt.Errorf("redis client is nil")
}
return NewGlobalLock(ctx, redisConn, uniqueKey), nil
return NewGlobalLock(ctx, redisConn, uniqueKey, globalOpts...)
}