diff options
-rw-r--r-- | changelogs/unreleased/bvl-circuitbreaker-improvements.yml | 5 | ||||
-rw-r--r-- | db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb | 27 | ||||
-rw-r--r-- | db/schema.rb | 6 |
3 files changed, 37 insertions, 1 deletions
diff --git a/changelogs/unreleased/bvl-circuitbreaker-improvements.yml b/changelogs/unreleased/bvl-circuitbreaker-improvements.yml new file mode 100644 index 00000000000..15cbd5592e9 --- /dev/null +++ b/changelogs/unreleased/bvl-circuitbreaker-improvements.yml @@ -0,0 +1,5 @@ +--- +title: Store circuitbreaker settings in the database instead of config +merge_request: 14842 +author: +type: changed diff --git a/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb b/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb new file mode 100644 index 00000000000..bcf7dbd8e64 --- /dev/null +++ b/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb @@ -0,0 +1,27 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddCircuitBreakerPropertiesToApplicationSettings < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :application_settings, + :circuitbreaker_failure_count_threshold, + :integer, + default: 160 + add_column :application_settings, + :circuitbreaker_failure_wait_time, + :integer, + default: 30 + add_column :application_settings, + :circuitbreaker_failure_reset_time, + :integer, + default: 1800 + add_column :application_settings, + :circuitbreaker_storage_timeout, + :integer, + default: 30 + end +end diff --git a/db/schema.rb b/db/schema.rb index 8aadcfeb7d1..c2c04873d4d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171006091000) do +ActiveRecord::Schema.define(version: 20171012101043) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -134,6 +134,10 @@ ActiveRecord::Schema.define(version: 20171006091000) do t.boolean "hashed_storage_enabled", default: false, null: false t.boolean "project_export_enabled", default: true, null: false t.boolean "auto_devops_enabled", default: false, null: false + t.integer "circuitbreaker_failure_count_threshold", default: 160 + t.integer "circuitbreaker_failure_wait_time", default: 30 + t.integer "circuitbreaker_failure_reset_time", default: 1800 + t.integer "circuitbreaker_storage_timeout", default: 30 end create_table "audit_events", force: :cascade do |t| |