Commit d13be3c2 authored by Matija Čupić's avatar Matija Čupić

Store OAuth token in Redis for worker to pick up

parent a180306d
...@@ -65,7 +65,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController ...@@ -65,7 +65,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end end
def authorize_google_project_billing def authorize_google_project_billing
CheckGcpProjectBillingWorker.perform_async(token_in_session) redis_token_key = CheckGcpProjectBillingWorker.generate_redis_token_key
Gitlab::Redis::SharedState.with do |redis|
redis.set(redis_token_key, token_in_session, ex: 5.minutes)
end
CheckGcpProjectBillingWorker.perform_async(redis_token_key)
end end
def google_project_billing_status def google_project_billing_status
......
...@@ -22,7 +22,7 @@ feature 'Gcp Cluster', :js do ...@@ -22,7 +22,7 @@ feature 'Gcp Cluster', :js do
context 'when user has a GCP project with billing enabled' do context 'when user has a GCP project with billing enabled' do
before do before do
allow(CheckGcpProjectBillingWorker).to receive(:perform_async) allow_any_instance_of(Projects::Clusters::GcpController).to receive(:authorize_google_project_billing)
stub_google_project_billing_status stub_google_project_billing_status
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