Commit 07537fac authored by Ayrton Araújo's avatar Ayrton Araújo

Add support to set satellites timeout

parent a6546f51
...@@ -197,6 +197,7 @@ production: &base ...@@ -197,6 +197,7 @@ production: &base
satellites: satellites:
# Relative paths are relative to Rails.root (default: tmp/repo_satellites/) # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
path: /home/git/gitlab-satellites/ path: /home/git/gitlab-satellites/
timeout: 30
## Backup settings ## Backup settings
backup: backup:
......
...@@ -139,6 +139,7 @@ Settings.git['timeout'] ||= 10 ...@@ -139,6 +139,7 @@ Settings.git['timeout'] ||= 10
Settings['satellites'] ||= Settingslogic.new({}) Settings['satellites'] ||= Settingslogic.new({})
Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root)
Settings.satellites['timeout'] ||= 30
# #
# Extra customization # Extra customization
......
module Gitlab module Gitlab
module Satellite module Satellite
class Action class Action
DEFAULT_OPTIONS = { git_timeout: 30.seconds } DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds }
attr_accessor :options, :project, :user attr_accessor :options, :project, :user
......
...@@ -5,6 +5,10 @@ describe 'Gitlab::Satellite::Action' do ...@@ -5,6 +5,10 @@ describe 'Gitlab::Satellite::Action' do
let(:user) { create(:user) } let(:user) { create(:user) }
describe '#prepare_satellite!' do 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 it 'create a repository with a parking branch and one remote: origin' do
repo = project.satellite.repo repo = project.satellite.repo
...@@ -113,4 +117,3 @@ describe 'Gitlab::Satellite::Action' do ...@@ -113,4 +117,3 @@ describe 'Gitlab::Satellite::Action' do
end end
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