필드 이름 변경

This commit is contained in:
2023-08-14 21:41:52 +09:00
parent a5b7e11964
commit 81d069cddf

View File

@ -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()
}