Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
9b8d0d898e
commit
f7a13c56bf
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Extend gRPC timeouts for Rake tasks
|
||||||
|
merge_request: 19461
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -383,13 +383,17 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.long_timeout
|
def self.long_timeout
|
||||||
if Sidekiq.server?
|
if web_app_server?
|
||||||
6.hours
|
|
||||||
else
|
|
||||||
default_timeout
|
default_timeout
|
||||||
|
else
|
||||||
|
6.hours
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.web_app_server?
|
||||||
|
defined?(::Unicorn) || defined?(::Puma)
|
||||||
|
end
|
||||||
|
|
||||||
def self.storage_metadata_file_path(storage)
|
def self.storage_metadata_file_path(storage)
|
||||||
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
|
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
|
||||||
File.join(
|
File.join(
|
||||||
|
|
|
@ -17,6 +17,28 @@ describe Gitlab::GitalyClient do
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '.long_timeout' do
|
||||||
|
context 'default case' do
|
||||||
|
it { expect(subject.long_timeout).to eq(6.hours) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'running in Unicorn' do
|
||||||
|
before do
|
||||||
|
stub_const('Unicorn', 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(subject.long_timeout).to eq(55) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'running in Puma' do
|
||||||
|
before do
|
||||||
|
stub_const('Puma', 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(subject.long_timeout).to eq(55) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '.filesystem_id_from_disk' do
|
describe '.filesystem_id_from_disk' do
|
||||||
it 'catches errors' do
|
it 'catches errors' do
|
||||||
[Errno::ENOENT, Errno::EACCES, JSON::ParserError].each do |error|
|
[Errno::ENOENT, Errno::EACCES, JSON::ParserError].each do |error|
|
||||||
|
|
Loading…
Reference in New Issue