Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/google_cloud')
-rw-r--r--app/workers/google_cloud/create_cloudsql_instance_worker.rb23
-rw-r--r--app/workers/google_cloud/fetch_google_ip_list_worker.rb17
2 files changed, 21 insertions, 19 deletions
diff --git a/app/workers/google_cloud/create_cloudsql_instance_worker.rb b/app/workers/google_cloud/create_cloudsql_instance_worker.rb
index 3c15c59b8d9..8c4f4c83339 100644
--- a/app/workers/google_cloud/create_cloudsql_instance_worker.rb
+++ b/app/workers/google_cloud/create_cloudsql_instance_worker.rb
@@ -8,30 +8,15 @@ module GoogleCloud
feature_category :not_owned # rubocop:disable Gitlab/AvoidFeatureCategoryNotOwned
idempotent!
- def perform(user_id, project_id, options = {})
+ def perform(user_id, project_id, params = {})
user = User.find(user_id)
project = Project.find(project_id)
+ params = params.with_indifferent_access
- google_oauth2_token = options[:google_oauth2_token]
- gcp_project_id = options[:gcp_project_id]
- instance_name = options[:instance_name]
- database_version = options[:database_version]
- environment_name = options[:environment_name]
- is_protected = options[:is_protected]
-
- params = {
- google_oauth2_token: google_oauth2_token,
- gcp_project_id: gcp_project_id,
- instance_name: instance_name,
- database_version: database_version,
- environment_name: environment_name,
- is_protected: is_protected
- }
-
- response = GoogleCloud::SetupCloudsqlInstanceService.new(project, user, params).execute
+ response = ::GoogleCloud::SetupCloudsqlInstanceService.new(project, user, params).execute
if response[:status] == :error
- raise response[:message]
+ raise "Error SetupCloudsqlInstanceService: #{response.to_json}"
end
end
end
diff --git a/app/workers/google_cloud/fetch_google_ip_list_worker.rb b/app/workers/google_cloud/fetch_google_ip_list_worker.rb
new file mode 100644
index 00000000000..b14b4e735dc
--- /dev/null
+++ b/app/workers/google_cloud/fetch_google_ip_list_worker.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module GoogleCloud
+ class FetchGoogleIpListWorker
+ include ApplicationWorker
+
+ data_consistency :delayed
+ feature_category :build_artifacts
+ urgency :low
+ deduplicate :until_executing
+ idempotent!
+
+ def perform
+ GoogleCloud::FetchGoogleIpListService.new.execute
+ end
+ end
+end