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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
17b44dce
Commit
17b44dce
authored
Jan 05, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use token hash for redis key
parent
571db1a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
app/workers/check_gcp_project_billing_worker.rb
app/workers/check_gcp_project_billing_worker.rb
+2
-2
No files found.
app/workers/check_gcp_project_billing_worker.rb
View file @
17b44dce
...
@@ -4,7 +4,7 @@ class CheckGcpProjectBillingWorker
...
@@ -4,7 +4,7 @@ class CheckGcpProjectBillingWorker
LEASE_TIMEOUT
=
15
.
seconds
.
to_i
LEASE_TIMEOUT
=
15
.
seconds
.
to_i
def
self
.
redis_shared_state_key_for
(
token
)
def
self
.
redis_shared_state_key_for
(
token
)
"gitlab:gcp:
#{
token
}
:billing_enabled"
"gitlab:gcp:
#{
token
.
hash
}
:billing_enabled"
end
end
def
perform
(
token
)
def
perform
(
token
)
...
@@ -21,7 +21,7 @@ class CheckGcpProjectBillingWorker
...
@@ -21,7 +21,7 @@ class CheckGcpProjectBillingWorker
def
try_obtain_lease_for
(
token
)
def
try_obtain_lease_for
(
token
)
Gitlab
::
ExclusiveLease
Gitlab
::
ExclusiveLease
.
new
(
"check_gcp_project_billing_worker:
#{
token
}
"
,
timeout:
LEASE_TIMEOUT
)
.
new
(
"check_gcp_project_billing_worker:
#{
token
.
hash
}
"
,
timeout:
LEASE_TIMEOUT
)
.
try_obtain
.
try_obtain
end
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