Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
69e9c414
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
69e9c414
编写于
11月 30, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'expire-application-settings-startup' of
https://gitlab.com/stanhu/gitlab-ce
上级
c48518ac
78c1ab40
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
30 addition
and
4 deletion
+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
未找到文件。
CHANGELOG
浏览文件 @
69e9c414
...
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased)
- Fix Error 500 when viewing user's personal projects from admin page (Stan Hu)
- Ensure cached application settings are refreshed at startup (Stan Hu)
- Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera)
- Fix 500 error when update group member permission
- Fix: Raw private snippets access workflow
...
...
app/models/application_setting.rb
浏览文件 @
69e9c414
...
...
@@ -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
浏览文件 @
69e9c414
...
...
@@ -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
浏览文件 @
69e9c414
...
...
@@ -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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录