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 <tmacam@burocrata.org>

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
This commit is contained in:
Tiago Alves Macambira 2022-08-12 17:49:48 -07:00 committed by GitHub
parent b3e18bb11d
commit 2050bb9514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -173,9 +173,9 @@ func (r *StandaloneRedisLock) Unlock(req *lock.UnlockRequest) (*lock.UnlockRespo
if i >= 0 { if i >= 0 {
status = lock.Success status = lock.Success
} else if i == -1 { } else if i == -1 {
status = lock.LockUnexist status = lock.LockDoesNotExist
} else if i == -2 { } else if i == -2 {
status = lock.LockBelongToOthers status = lock.LockBelongsToOthers
} }
return &lock.UnlockResponse{ return &lock.UnlockResponse{
Status: status, Status: status,

View File

@ -27,8 +27,8 @@ type Status int32
// lock status. // lock status.
const ( const (
Success Status = 0 Success Status = 0
LockUnexist Status = 1 LockDoesNotExist Status = 1
LockBelongToOthers Status = 2 LockBelongsToOthers Status = 2
InternalError Status = 3 InternalError Status = 3
) )