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

Use token hash for redis key

parent 571db1a2
......@@ -4,7 +4,7 @@ class CheckGcpProjectBillingWorker
LEASE_TIMEOUT = 15.seconds.to_i
def self.redis_shared_state_key_for(token)
"gitlab:gcp:#{token}:billing_enabled"
"gitlab:gcp:#{token.hash}:billing_enabled"
end
def perform(token)
......@@ -21,7 +21,7 @@ class CheckGcpProjectBillingWorker
def try_obtain_lease_for(token)
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
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