@@ -0,0 +1,11 @@
|
||||
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...)
|
||||
}
|
||||
Reference in New Issue
Block a user