Commit 3b161251 authored by Matija Čupić's avatar Matija Čupić

Rename CheckGcpProjectBillingWorker to ListGcpProjectsWorker

parent cffc8899
...@@ -83,12 +83,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController ...@@ -83,12 +83,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end end
def authorize_google_project_billing def authorize_google_project_billing
redis_token_key = CheckGcpProjectBillingWorker.store_session_token(token_in_session) redis_token_key = ListGcpProjectsWorker.store_session_token(token_in_session)
CheckGcpProjectBillingWorker.perform_async(redis_token_key) ListGcpProjectsWorker.perform_async(redis_token_key)
end end
def google_project_billing_status def google_project_billing_status
CheckGcpProjectBillingWorker.get_billing_state(token_in_session) ListGcpProjectsWorker.get_billing_state(token_in_session)
end end
def token_in_session def token_in_session
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- gcp_cluster:cluster_provision - gcp_cluster:cluster_provision
- gcp_cluster:cluster_wait_for_app_installation - gcp_cluster:cluster_wait_for_app_installation
- gcp_cluster:wait_for_cluster_creation - gcp_cluster:wait_for_cluster_creation
- gcp_cluster:check_gcp_project_billing - gcp_cluster:list_gcp_projects
- gcp_cluster:cluster_wait_for_ingress_ip_address - gcp_cluster:cluster_wait_for_ingress_ip_address
- github_import_advance_stage - github_import_advance_stage
......
require 'securerandom' require 'securerandom'
class CheckGcpProjectBillingWorker class ListGcpProjectsWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
...@@ -64,7 +64,7 @@ class CheckGcpProjectBillingWorker ...@@ -64,7 +64,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.hash}", timeout: LEASE_TIMEOUT) .new("list_gcp_projects_worker:#{token.hash}", timeout: LEASE_TIMEOUT)
.try_obtain .try_obtain
end end
......
...@@ -144,7 +144,7 @@ describe Projects::Clusters::GcpController do ...@@ -144,7 +144,7 @@ describe Projects::Clusters::GcpController do
before do before do
redis_double = double redis_double = double
allow(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis_double) allow(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis_double)
allow(redis_double).to receive(:get).with(CheckGcpProjectBillingWorker.redis_shared_state_key_for('token')).and_return('true') allow(redis_double).to receive(:get).with(ListGcpProjectsWorker.redis_shared_state_key_for('token')).and_return('true')
end end
it 'creates a new cluster' do it 'creates a new cluster' do
......
require 'spec_helper' require 'spec_helper'
describe CheckGcpProjectBillingWorker do describe ListGcpProjectsWorker do
describe '.perform' do describe '.perform' do
let(:token) { 'bogustoken' } let(:token) { 'bogustoken' }
......
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