diff --git a/locker_redis.go b/locker_redis.go index 3fe838c..a6d2c21 100644 --- a/locker_redis.go +++ b/locker_redis.go @@ -16,7 +16,7 @@ var txSetArgs redis.SetArgs = redis.SetArgs{ } type LockerWithRedis struct { - key string + locked_key string } var ErrTransactionLocked = errors.New("transaction is already locked") @@ -34,10 +34,10 @@ func (locker *LockerWithRedis) Lock(rc *redis.Client, key string) error { return ErrTransactionLocked } - locker.key = key + locker.locked_key = key return nil } func (locker *LockerWithRedis) Unlock(rc *redis.Client) { - rc.Del(context.Background(), locker.key).Result() + rc.Del(context.Background(), locker.locked_key).Result() }