Merge branch 'sh-fix-gitaly-server-info-cache' into 'master'
Fix Gitaly auto-detection caching Closes #64802 See merge request gitlab-org/gitlab-ce!30954
This commit is contained in:
commit
eb3f465e75
3 changed files with 19 additions and 1 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Fix Gitaly auto-detection caching
|
||||||
|
merge_request: 30954
|
||||||
|
author:
|
||||||
|
type: performance
|
|
@ -392,7 +392,7 @@ module Gitlab
|
||||||
@can_use_disk[storage]
|
@can_use_disk[storage]
|
||||||
end
|
end
|
||||||
|
|
||||||
return cached_value if cached_value.present?
|
return cached_value unless cached_value.nil?
|
||||||
|
|
||||||
gitaly_filesystem_id = filesystem_id(storage)
|
gitaly_filesystem_id = filesystem_id(storage)
|
||||||
direct_filesystem_id = filesystem_id_from_disk(storage)
|
direct_filesystem_id = filesystem_id_from_disk(storage)
|
||||||
|
|
|
@ -119,6 +119,19 @@ describe Gitlab::GitalyClient do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '.can_use_disk?' do
|
||||||
|
it 'properly caches a false result' do
|
||||||
|
# spec_helper stubs this globally
|
||||||
|
allow(described_class).to receive(:can_use_disk?).and_call_original
|
||||||
|
expect(described_class).to receive(:filesystem_id).once
|
||||||
|
expect(described_class).to receive(:filesystem_id_from_disk).once
|
||||||
|
|
||||||
|
2.times do
|
||||||
|
described_class.can_use_disk?('unknown')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '.connection_data' do
|
describe '.connection_data' do
|
||||||
it 'returns connection data' do
|
it 'returns connection data' do
|
||||||
address = 'tcp://localhost:9876'
|
address = 'tcp://localhost:9876'
|
||||||
|
|
Loading…
Reference in a new issue