From 2050bb951466c143e83e340594c93e883f230c2e Mon Sep 17 00:00:00 2001 From: Tiago Alves Macambira Date: Fri, 12 Aug 2022 17:49:48 -0700 Subject: [PATCH] Update code to reflect renaming on UnlockResponse.Status (#1958) PR dapr/dapr#4989 (issue dapr/dapr#4988) updated the names of some enums in `UnlockResponse.Status` ProtoBuff definition: * `LOCK_UNEXIST` became `LOCK_DOES_NOT_EXIST ` * `LOCK_BELONG_TO_OTHERS` became `LOCK_BELONGS_TO_OTHERS` Code implementing Distributed Lock component in components-contrib needs to be updated to account for this modification. This PR accomplishes this by updating contants mapping back to the two enums above to match their new names. Fixes components-contrib#1950 Signed-off-by: Tiago Alves Macambira Signed-off-by: Tiago Alves Macambira Co-authored-by: Loong Dai Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com> --- lock/redis/standalone.go | 4 ++-- lock/responses.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lock/redis/standalone.go b/lock/redis/standalone.go index 137e2a0c1..0f7ad7154 100644 --- a/lock/redis/standalone.go +++ b/lock/redis/standalone.go @@ -173,9 +173,9 @@ func (r *StandaloneRedisLock) Unlock(req *lock.UnlockRequest) (*lock.UnlockRespo if i >= 0 { status = lock.Success } else if i == -1 { - status = lock.LockUnexist + status = lock.LockDoesNotExist } else if i == -2 { - status = lock.LockBelongToOthers + status = lock.LockBelongsToOthers } return &lock.UnlockResponse{ Status: status, diff --git a/lock/responses.go b/lock/responses.go index 94b3e0aa4..c6308b737 100644 --- a/lock/responses.go +++ b/lock/responses.go @@ -27,8 +27,8 @@ type Status int32 // lock status. const ( - Success Status = 0 - LockUnexist Status = 1 - LockBelongToOthers Status = 2 - InternalError Status = 3 + Success Status = 0 + LockDoesNotExist Status = 1 + LockBelongsToOthers Status = 2 + InternalError Status = 3 )