diff options
author | Tiger <twatson@gitlab.com> | 2019-03-12 09:37:37 +0300 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-03-20 04:04:46 +0300 |
commit | 759dab5b69f53a861045ebbc84836f83c7502af2 (patch) | |
tree | cf3860848dbcdd4f9b9011232d139b3cec5663a7 /app/workers | |
parent | 42c6ccd2098ec98e5244e743a0c39634f076f66f (diff) |
Add feature flag for build preparing state
The flag is on by default, but allows us to revert back
to the old behaviour if we encounter any problems.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/cluster_configure_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/cluster_project_configure_worker.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/app/workers/cluster_configure_worker.rb b/app/workers/cluster_configure_worker.rb index 63e6cc147be..b984dee5b21 100644 --- a/app/workers/cluster_configure_worker.rb +++ b/app/workers/cluster_configure_worker.rb @@ -5,6 +5,8 @@ class ClusterConfigureWorker include ClusterQueue def perform(cluster_id) + return if Feature.enabled?(:ci_preparing_state, default_enabled: true) + Clusters::Cluster.find_by_id(cluster_id).try do |cluster| Clusters::RefreshService.create_or_update_namespaces_for_cluster(cluster) end diff --git a/app/workers/cluster_project_configure_worker.rb b/app/workers/cluster_project_configure_worker.rb index 497e57c0d0b..d7bea69a01c 100644 --- a/app/workers/cluster_project_configure_worker.rb +++ b/app/workers/cluster_project_configure_worker.rb @@ -5,6 +5,8 @@ class ClusterProjectConfigureWorker include ClusterQueue def perform(project_id) + return if Feature.enabled?(:ci_preparing_state, default_enabled: true) + project = Project.find(project_id) ::Clusters::RefreshService.create_or_update_namespaces_for_project(project) |