diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-01-04 09:41:28 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-01-04 09:41:28 +0000 |
commit | f8696018cc81419474cf738a0cd9c5523c3a4a30 (patch) | |
tree | c2bf4c2da9f97a2e985c0a54a4072abe88c6abe3 | |
parent | 34e1c18c53d584e46165fcfdce72a0b23443d22c (diff) | |
parent | 2802d4992d064e63cf2015c7bb002318eaa84c41 (diff) | |
download | gitlab-ce-f8696018cc81419474cf738a0cd9c5523c3a4a30.tar.gz |
Merge branch 'expire-cache-on-app-settings-change' into 'master'
Expire view caches when application settings change
If the admin disables Gravatar, for example, before the views would not invalidate. Now they invalidate automatically when this happens.
Closes #5728
See merge request !2280
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/views/events/_event.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/commits/_commit.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/projects/_project.html.haml | 2 |
4 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG index 2b7d5808e7e..b25e0eabd7d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.4.0 (unreleased) + - Expire view caches when application settings change (e.g. Gravatar disabled) (Stan Hu) - Implement new UI for group page - Implement search inside emoji picker - Add API support for looking up a user by username (Stan Hu) diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index 9aacc79d686..46432a92348 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -3,7 +3,7 @@ .event-item-timestamp #{time_ago_with_tooltip(event.created_at)} - = cache [event, "v2.1"] do + = cache [event, current_application_settings, "v2.1"] do = image_tag avatar_icon(event.author_email, 46), class: "avatar s46", alt:'' - if event.created_project? = render "events/event/created_project", event: event diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 28b82dd31f3..012825f0fdb 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -5,7 +5,7 @@ - note_count = notes.user.count - ci_commit = project.ci_commit(commit.sha) -- cache_key = [project.path_with_namespace, commit.id, note_count] +- cache_key = [project.path_with_namespace, commit.id, current_application_settings, note_count] - cache_key.push(ci_commit.status) if ci_commit = cache(cache_key) do diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index c36995b94d7..86249851a82 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -5,7 +5,7 @@ - css_class = '' unless local_assigns[:css_class] - css_class += " no-description" unless project.description.present? %li.project-row{ class: css_class } - = cache [project.namespace, project, controller.controller_name, controller.action_name, 'v2.2'] do + = cache [project.namespace, project, controller.controller_name, controller.action_name, current_application_settings, 'v2.2'] do = link_to project_path(project), class: dom_class(project) do - if avatar .dash-project-avatar |