Files
51dj_server/common/redis/redsync.go
T
2026-10-08 16:50:13 +08:00

12 lines
320 B
Go

package redis
import (
"github.com/go-redsync/redsync/v4"
"github.com/go-redsync/redsync/v4/redis/goredis"
)
// BuildLock 构建redis分布式锁。
func BuildLock(client *Client, key string, options ...redsync.Option) *redsync.Mutex {
return redsync.New(goredis.NewPool(client.client)).NewMutex(key, options...)
}