Commit ed234e34 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7316 from ayr-ton/master

Add support to set satellites timeout
parents 136ff572 07537fac
......@@ -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
......
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
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