Skip to content
Snippets Groups Projects
Verified Commit d13be3c2 authored by Matija Čupić's avatar Matija Čupić
Browse files

Store OAuth token in Redis for worker to pick up

parent a180306d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -65,7 +65,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end
 
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
 
def google_project_billing_status
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ feature 'Gcp Cluster', :js do
 
context 'when user has a GCP project with billing enabled' 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
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment