Add support to set satellites timeout
This commit is contained in:
parent
a6546f51e2
commit
07537faca7
4 changed files with 7 additions and 2 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue