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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
3b9a9109
Commit
3b9a9109
authored
Nov 30, 2015
by
Dmitriy Zaporozhets
Committed by
Robert Speicher
Nov 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'expire-application-settings-startup' of
https://gitlab.com/stanhu/gitlab-ce
parent
0bbf7563
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
4 deletions
+30
-4
CHANGELOG
CHANGELOG
+1
-0
app/models/application_setting.rb
app/models/application_setting.rb
+10
-2
app/models/ci/application_setting.rb
app/models/ci/application_setting.rb
+10
-2
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+9
-0
No files found.
CHANGELOG
View file @
3b9a9109
Please view this file on the master branch, on stable branches it's out of date.
v 8.2.2
- Ensure cached application settings are refreshed at startup (Stan Hu)
- Fix: Raw private snippets access workflow
- Prevent "413 Request entity too large" errors when pushing large files with LFS
...
...
app/models/application_setting.rb
View file @
3b9a9109
...
...
@@ -73,15 +73,23 @@ class ApplicationSetting < ActiveRecord::Base
end
after_commit
do
Rails
.
cache
.
write
(
'application_setting.last'
,
self
)
Rails
.
cache
.
write
(
cache_key
,
self
)
end
def
self
.
current
Rails
.
cache
.
fetch
(
'application_setting.last'
)
do
Rails
.
cache
.
fetch
(
cache_key
)
do
ApplicationSetting
.
last
end
end
def
self
.
expire
Rails
.
cache
.
delete
(
cache_key
)
end
def
self
.
cache_key
'application_setting.last'
end
def
self
.
create_from_defaults
create
(
default_projects_limit:
Settings
.
gitlab
[
'default_projects_limit'
],
...
...
app/models/ci/application_setting.rb
View file @
3b9a9109
...
...
@@ -14,11 +14,15 @@ module Ci
extend
Ci
::
Model
after_commit
do
Rails
.
cache
.
write
(
'ci_application_setting.last'
,
self
)
Rails
.
cache
.
write
(
cache_key
,
self
)
end
def
self
.
expire
Rails
.
cache
.
delete
(
cache_key
)
end
def
self
.
current
Rails
.
cache
.
fetch
(
'ci_application_setting.last'
)
do
Rails
.
cache
.
fetch
(
cache_key
)
do
Ci
::
ApplicationSetting
.
last
end
end
...
...
@@ -29,5 +33,9 @@ module Ci
add_pusher:
Settings
.
gitlab_ci
[
'add_pusher'
],
)
end
def
self
.
cache_key
'ci_application_setting.last'
end
end
end
config/initializers/1_settings.rb
View file @
3b9a9109
...
...
@@ -293,3 +293,12 @@ if Rails.env.test?
Settings
.
gitlab
[
'default_can_create_group'
]
=
true
Settings
.
gitlab
[
'default_can_create_team'
]
=
false
end
# Force a refresh of application settings at startup
begin
ApplicationSetting
.
expire
Ci
::
ApplicationSetting
.
expire
rescue
# Gracefully handle when Redis is not available. For example,
# omnibus may fail here during assets:precompile.
end
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