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:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-10-09 08:59:42 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-10-10 10:08:18 +0300
commit30b4ce940d28804e0b38ea9ea4f89793d41392db (patch)
treeecbf29b27a726867d260521dc799214a4cd6d4c4 /db/post_migrate
parent550f55745a3be5f86bafaf25b3bcc90beba8e2ac (diff)
Remove Git circuit breaker
Was introduced in the time that GitLab still used NFS, which is not required anymore in most cases. By removing this, the API it calls will return empty responses. This interface has to be removed in the next major release, expected to be 12.0.
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20181008200441_remove_circuit_breaker.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/db/post_migrate/20181008200441_remove_circuit_breaker.rb b/db/post_migrate/20181008200441_remove_circuit_breaker.rb
new file mode 100644
index 00000000000..838addb7286
--- /dev/null
+++ b/db/post_migrate/20181008200441_remove_circuit_breaker.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class RemoveCircuitBreaker < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ CIRCUIT_BREAKER_COLUMS_WITH_DEFAULT = {
+ circuitbreaker_failure_count_threshold: 3,
+ circuitbreaker_failure_reset_time: 1800,
+ circuitbreaker_storage_timeout: 15,
+ circuitbreaker_access_retries: 3,
+ circuitbreaker_check_interval: 1
+ }.freeze
+
+ def up
+ CIRCUIT_BREAKER_COLUMS_WITH_DEFAULT.keys.each do |column|
+ remove_column(:application_settings, column) if column_exists?(:application_settings, column)
+ end
+ end
+
+ def down
+ CIRCUIT_BREAKER_COLUMS_WITH_DEFAULT.each do |column, default|
+ add_column_with_default(:application_settings, column, :integer, default: default) unless column_exists?(:application_settings, column)
+ end
+ end
+end