diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 19:17:31 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 19:17:31 +0300 |
commit | ed234e344e63cb76609c7877235ee5408afea21c (patch) | |
tree | 34d4f6e230d6da77c1e4e6366e817098452de814 | |
parent | 136ff572110ec0b9f0a8643acedb0c09b25b18f7 (diff) | |
parent | 07537faca72e2475a25e1e73c12bc924499afc27 (diff) | |
download | gitlab-ce-ed234e344e63cb76609c7877235ee5408afea21c.tar.gz |
Merge pull request #7316 from ayr-ton/master
Add support to set satellites timeout
-rw-r--r-- | config/gitlab.yml.example | 1 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/satellite/action.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/satellite/action_spec.rb | 5 |
4 files changed, 7 insertions, 2 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index d57f3b508bb..250a4908c58 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -197,6 +197,7 @@ production: &base satellites: # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) path: /home/git/gitlab-satellites/ + timeout: 30 ## Backup settings backup: diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 0480ec8ecfd..49e35d5bb68 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -139,6 +139,7 @@ Settings.git['timeout'] ||= 10 Settings['satellites'] ||= Settingslogic.new({}) Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) +Settings.satellites['timeout'] ||= 30 # # Extra customization diff --git a/lib/gitlab/satellite/action.rb b/lib/gitlab/satellite/action.rb index 5ea6f956765..be45cb5c98e 100644 --- a/lib/gitlab/satellite/action.rb +++ b/lib/gitlab/satellite/action.rb @@ -1,7 +1,7 @@ module Gitlab module Satellite class Action - DEFAULT_OPTIONS = { git_timeout: 30.seconds } + DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } attr_accessor :options, :project, :user diff --git a/spec/lib/gitlab/satellite/action_spec.rb b/spec/lib/gitlab/satellite/action_spec.rb index d65e7c42b7e..9ec0d6aad8c 100644 --- a/spec/lib/gitlab/satellite/action_spec.rb +++ b/spec/lib/gitlab/satellite/action_spec.rb @@ -5,6 +5,10 @@ describe 'Gitlab::Satellite::Action' do let(:user) { create(:user) } describe '#prepare_satellite!' do + it 'should be able to fetch timeout from conf' do + Gitlab.config.satellites.timeout = 30 + DEFAULT_OPTIONS['git_timeout'].should == 30.seconds + end it 'create a repository with a parking branch and one remote: origin' do repo = project.satellite.repo @@ -113,4 +117,3 @@ describe 'Gitlab::Satellite::Action' do end end - |