summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-10-04 02:33:37 +0900
committerShinya Maeda <shinya@gitlab.com>2017-10-04 02:33:37 +0900
commit1ce09b6ed5a1d8eb00c2103e9b1595877a636be1 (patch)
tree617c08ac7bd3e01647258f6e91c593a0513df22b
parent6b7889f750c56962c0674467c3fbfd7976b9b44f (diff)
downloadgitlab-ce-1ce09b6ed5a1d8eb00c2103e9b1595877a636be1.tar.gz
Introduce manage_cluster queue for sidekiq workers
-rw-r--r--app/workers/cluster_creation_worker.rb2
-rw-r--r--app/workers/concerns/cluster_queue.rb10
-rw-r--r--app/workers/wait_for_cluster_creation_worker.rb2
-rw-r--r--config/sidekiq_queues.yml3
4 files changed, 13 insertions, 4 deletions
diff --git a/app/workers/cluster_creation_worker.rb b/app/workers/cluster_creation_worker.rb
index 220519134b9..d4ca9029a91 100644
--- a/app/workers/cluster_creation_worker.rb
+++ b/app/workers/cluster_creation_worker.rb
@@ -1,6 +1,6 @@
class ClusterCreationWorker
include Sidekiq::Worker
- include DedicatedSidekiqQueue
+ include ClusterQueue
def perform(cluster_id)
Gcp::Cluster.find_by_id(cluster_id).try do |cluster|
diff --git a/app/workers/concerns/cluster_queue.rb b/app/workers/concerns/cluster_queue.rb
new file mode 100644
index 00000000000..736ae90303c
--- /dev/null
+++ b/app/workers/concerns/cluster_queue.rb
@@ -0,0 +1,10 @@
+##
+# Concern for setting Sidekiq settings for the various Gcp clusters workers.
+#
+module ClusterQueue
+ extend ActiveSupport::Concern
+
+ included do
+ sidekiq_options queue: :manage_cluster
+ end
+end
diff --git a/app/workers/wait_for_cluster_creation_worker.rb b/app/workers/wait_for_cluster_creation_worker.rb
index d1f9b4e07f4..3b9978e986a 100644
--- a/app/workers/wait_for_cluster_creation_worker.rb
+++ b/app/workers/wait_for_cluster_creation_worker.rb
@@ -1,6 +1,6 @@
class WaitForClusterCreationWorker
include Sidekiq::Worker
- include DedicatedSidekiqQueue
+ include ClusterQueue
INITIAL_INTERVAL = 2.minutes
EAGER_INTERVAL = 10.seconds
diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml
index 1af90d0a361..c60a2baf940 100644
--- a/config/sidekiq_queues.yml
+++ b/config/sidekiq_queues.yml
@@ -62,5 +62,4 @@
- [update_user_activity, 1]
- [propagate_service_template, 1]
- [background_migration, 1]
- - [cluster_creation, 1]
- - [wait_for_cluster_creation, 1]
+ - [manage_cluster, 1]