Add Geo status connection timeout setting to ApplicationSetting

parent b546ade1
......@@ -171,7 +171,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:repository_size_limit,
:shared_runners_minutes,
:usage_ping_enabled,
:minimum_mirror_sync_time
:minimum_mirror_sync_time,
:geo_status_timeout
]
end
end
module Geo
class NodeStatusService
include Gitlab::CurrentSettings
include HTTParty
KEYS = %w(health repositories_count repositories_synced_count repositories_failed_count).freeze
# HTTParty timeout
default_timeout Gitlab.config.gitlab.geo_status_timeout
default_timeout current_application_settings.geo_status_timeout
def call(status_url)
values =
......
......@@ -619,5 +619,18 @@
Maximum time for web terminal websocket connection (in seconds).
0 for unlimited.
- if Gitlab::Geo.license_allows?
%fieldset
%legend GitLab Geo
%p
These settings will only take effect if Geo is enabled and require a restart to take effect.
.form-group
= f.label :geo_status_timeout, 'Connection timeout', class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :geo_status_timeout, class: 'form-control'
.help-block
The amount of seconds after which a request to get a secondary node
status will time out.
.form-actions
= f.submit 'Save', class: 'btn btn-save'
......@@ -102,11 +102,6 @@ production: &base
# The default is 'shared/cache/archive/' relative to the root of the Rails app.
# repository_downloads_path: shared/cache/archive/
## Geo settings
# NOTE: This will only take effect if Geo is enabled
# Number of seconds to wait for HTTP response after sending status HTTP GET request to secondary nodes (default: 10)
# geo_status_timeout: 10
## Reply by email
# Allow users to comment on issues and merge requests by replying to notification emails.
# For documentation on how to set this up, see http://doc.gitlab.com/ce/administration/reply_by_email.html
......
class AddGeoStatusTimoutToApplicationSettings < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :application_settings, :geo_status_timeout, :integer, default: 10
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170306180725) do
ActiveRecord::Schema.define(version: 20170308015651) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -125,6 +125,7 @@ ActiveRecord::Schema.define(version: 20170306180725) do
t.string "elasticsearch_aws_region", default: "us-east-1"
t.string "elasticsearch_aws_access_key"
t.string "elasticsearch_aws_secret_access_key"
t.integer "geo_status_timeout", default: 10
end
create_table "approvals", force: :cascade do |t|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment