BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2d83e4c5
Commit
2d83e4c5
authored
May 12, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dz-project-list-cache-key' into 'master'
Improve project list cache key Closes #31863 See merge request !11325
parents
ec1a3c09
bbd1be00
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
projects_helper.rb
app/helpers/projects_helper.rb
+9
-1
route.rb
app/models/route.rb
+1
-1
dz-project-list-cache-key.yml
changelogs/unreleased/dz-project-list-cache-key.yml
+4
-0
projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+2
-2
No files found.
app/helpers/projects_helper.rb
View file @
2d83e4c5
...
...
@@ -157,7 +157,15 @@ module ProjectsHelper
end
def
project_list_cache_key
(
project
)
key
=
[
project
.
namespace
.
cache_key
,
project
.
cache_key
,
controller
.
controller_name
,
controller
.
action_name
,
current_application_settings
.
cache_key
,
'v2.4'
]
key
=
[
project
.
route
.
cache_key
,
project
.
cache_key
,
controller
.
controller_name
,
controller
.
action_name
,
current_application_settings
.
cache_key
,
'v2.4'
]
key
<<
pipeline_status_cache_key
(
project
.
pipeline_status
)
if
project
.
pipeline_status
.
has_status?
key
...
...
app/models/route.rb
View file @
2d83e4c5
...
...
@@ -35,7 +35,7 @@ class Route < ActiveRecord::Base
old_path
=
route
.
path
# Callbacks must be run manually
route
.
update_columns
(
attributes
)
route
.
update_columns
(
attributes
.
merge
(
updated_at:
Time
.
now
)
)
# We are not calling route.delete_conflicting_redirects here, in hopes
# of avoiding deadlocks. The parent (self, in this method) already
...
...
changelogs/unreleased/dz-project-list-cache-key.yml
0 → 100644
View file @
2d83e4c5
---
title
:
Use route.cache_key for project list cache key
merge_request
:
11325
author
:
spec/helpers/projects_helper_spec.rb
View file @
2d83e4c5
...
...
@@ -66,8 +66,8 @@ describe ProjectsHelper do
describe
"#project_list_cache_key"
,
redis:
true
do
let
(
:project
)
{
create
(
:project
)
}
it
"includes the
namespac
e"
do
expect
(
helper
.
project_list_cache_key
(
project
)).
to
include
(
project
.
namespac
e
.
cache_key
)
it
"includes the
rout
e"
do
expect
(
helper
.
project_list_cache_key
(
project
)).
to
include
(
project
.
rout
e
.
cache_key
)
end
it
"includes the project"
do
...
...
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