未验证 提交 1bcdd25c 编写于 作者: S Stan Hu 提交者: Rémy Coutable

Avoid sequential scans loading schema_migrations table when loading application settings

This was causing significant performance problems in production, and this commit
reverts to the original behavior.
上级 2abc5316
......@@ -24,7 +24,20 @@ module Gitlab
private
def ensure_application_settings!
cached_application_settings || uncached_application_settings
end
def cached_application_settings
return in_memory_application_settings if ENV['IN_MEMORY_APPLICATION_SETTINGS'] == 'true'
begin
::ApplicationSetting.cached
rescue ::Redis::BaseError, ::Errno::ENOENT, ::Errno::EADDRNOTAVAIL
# In case Redis isn't running or the Redis UNIX socket file is not available
end
end
def uncached_application_settings
return fake_application_settings unless connect_to_db?
current_settings = ::ApplicationSetting.current
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册