Add support to set satellites timeout

This commit is contained in:
Ayrton Araújo 2014-07-15 14:27:35 -04:00
parent a6546f51e2
commit 07537faca7
4 changed files with 7 additions and 2 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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