Commit 17b44dce authored by Matija Čupić's avatar Matija Čupić

Use token hash for redis key

parent 571db1a2
No related merge requests found
...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment