summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-01-07 16:28:16 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-01-07 16:28:16 +0000
commit684e574abafb6d31b713ca0e5c4fc0c0c66b7846 (patch)
tree6d6ad7d1e6842a96bc0cf903ef22aa4b9b6a2471
parente7a8564f39a46a5fa5f34f798b890c0a62ff12e2 (diff)
downloadgitlab-ce-39957-redirect-to-gpc-page-if-users-try-to-create-a-cluster-but-the-account-is-not-enabled.tar.gz
-rw-r--r--app/workers/check_gcp_project_billing_worker.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/workers/check_gcp_project_billing_worker.rb b/app/workers/check_gcp_project_billing_worker.rb
index 96d5c2a2193..557af14ee57 100644
--- a/app/workers/check_gcp_project_billing_worker.rb
+++ b/app/workers/check_gcp_project_billing_worker.rb
@@ -6,6 +6,7 @@ class CheckGcpProjectBillingWorker
LEASE_TIMEOUT = 15.seconds.to_i
SESSION_KEY_TIMEOUT = 5.minutes
+ BILLING_TIMEOUT = 1.hour
def self.get_session_token(token_key)
Gitlab::Redis::SharedState.with do |redis|
@@ -34,7 +35,9 @@ class CheckGcpProjectBillingWorker
billing_enabled_projects = CheckGcpProjectBillingService.new.execute(token)
Gitlab::Redis::SharedState.with do |redis|
- redis.set(self.class.redis_shared_state_key_for(token), !billing_enabled_projects.empty?)
+ redis.set(self.class.redis_shared_state_key_for(token),
+ !billing_enabled_projects.empty?,
+ ex: BILLING_TIMEOUT)
end
end