Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
03e538b7
Commit
03e538b7
authored
Jun 20, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change references from ApplicationSetting to ::ApplicationSetting to make autoload happier
Closes #34047
parent
b2e1d32e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lib/gitlab/current_settings.rb
lib/gitlab/current_settings.rb
+5
-5
No files found.
lib/gitlab/current_settings.rb
View file @
03e538b7
...
@@ -10,7 +10,7 @@ module Gitlab
...
@@ -10,7 +10,7 @@ module Gitlab
delegate
:sidekiq_throttling_enabled?
,
to: :current_application_settings
delegate
:sidekiq_throttling_enabled?
,
to: :current_application_settings
def
fake_application_settings
(
defaults
=
ApplicationSetting
.
defaults
)
def
fake_application_settings
(
defaults
=
::
ApplicationSetting
.
defaults
)
FakeApplicationSettings
.
new
(
defaults
)
FakeApplicationSettings
.
new
(
defaults
)
end
end
...
@@ -24,7 +24,7 @@ module Gitlab
...
@@ -24,7 +24,7 @@ module Gitlab
def
cached_application_settings
def
cached_application_settings
begin
begin
ApplicationSetting
.
cached
::
ApplicationSetting
.
cached
rescue
::
Redis
::
BaseError
,
::
Errno
::
ENOENT
rescue
::
Redis
::
BaseError
,
::
Errno
::
ENOENT
# In case Redis isn't running or the Redis UNIX socket file is not available
# In case Redis isn't running or the Redis UNIX socket file is not available
end
end
...
@@ -35,7 +35,7 @@ module Gitlab
...
@@ -35,7 +35,7 @@ module Gitlab
# This loads from the database into the cache, so handle Redis errors
# This loads from the database into the cache, so handle Redis errors
begin
begin
db_settings
=
ApplicationSetting
.
current
db_settings
=
::
ApplicationSetting
.
current
rescue
::
Redis
::
BaseError
,
::
Errno
::
ENOENT
rescue
::
Redis
::
BaseError
,
::
Errno
::
ENOENT
# In case Redis isn't running or the Redis UNIX socket file is not available
# In case Redis isn't running or the Redis UNIX socket file is not available
end
end
...
@@ -45,14 +45,14 @@ module Gitlab
...
@@ -45,14 +45,14 @@ module Gitlab
# and other callers from failing, use any loaded settings and return
# and other callers from failing, use any loaded settings and return
# defaults for missing columns.
# defaults for missing columns.
if
ActiveRecord
::
Migrator
.
needs_migration?
if
ActiveRecord
::
Migrator
.
needs_migration?
defaults
=
ApplicationSetting
.
defaults
defaults
=
::
ApplicationSetting
.
defaults
defaults
.
merge!
(
db_settings
.
attributes
.
symbolize_keys
)
if
db_settings
.
present?
defaults
.
merge!
(
db_settings
.
attributes
.
symbolize_keys
)
if
db_settings
.
present?
return
fake_application_settings
(
defaults
)
return
fake_application_settings
(
defaults
)
end
end
return
db_settings
if
db_settings
.
present?
return
db_settings
if
db_settings
.
present?
ApplicationSetting
.
create_from_defaults
||
in_memory_application_settings
::
ApplicationSetting
.
create_from_defaults
||
in_memory_application_settings
end
end
def
in_memory_application_settings
def
in_memory_application_settings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment