Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
df7f62b9
Commit
df7f62b9
authored
Apr 29, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-use class method for cancel
parent
d3f9764b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lib/gitlab/exclusive_lease.rb
lib/gitlab/exclusive_lease.rb
+3
-4
No files found.
lib/gitlab/exclusive_lease.rb
View file @
df7f62b9
...
...
@@ -34,8 +34,9 @@ module Gitlab
end
def
self
.
cancel
(
key
,
uuid
)
key
=
key
&
.
start_with?
(
'gitlab:exclusive_lease:'
)
?
key
:
redis_shared_state_key
(
key
)
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
redis
.
eval
(
LUA_CANCEL_SCRIPT
,
keys:
[
redis_shared_state_key
(
key
)
],
argv:
[
uuid
])
redis
.
eval
(
LUA_CANCEL_SCRIPT
,
keys:
[
key
],
argv:
[
uuid
])
end
end
...
...
@@ -97,9 +98,7 @@ module Gitlab
# Gives up this lease, allowing it to be obtained by others.
def
cancel
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
redis
.
eval
(
LUA_CANCEL_SCRIPT
,
keys:
[
@redis_shared_state_key
],
argv:
[
@uuid
])
end
self
.
class
.
cancel
(
@redis_shared_state_key
,
@uuid
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment