Skip to content
Snippets Groups Projects
Commit 6a0178d8 authored by Rubén Dávila's avatar Rubén Dávila
Browse files

Invalidate cache with project details when repository is updated

The partial using this cache key was showing stale information due to
the cache not being invalidated.
parent f646a8b9
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -171,6 +171,7 @@ module ProjectsHelper
key = [
project.route.cache_key,
project.cache_key,
project.last_activity_date,
controller.controller_name,
controller.action_name,
Gitlab::CurrentSettings.cache_key,
Loading
Loading
---
title: Invalidate cache with project details when repository is updated
merge_request: 19774
author:
type: fixed
Loading
Loading
@@ -90,6 +90,10 @@ describe ProjectsHelper do
expect(helper.project_list_cache_key(project)).to include(project.cache_key)
end
 
it "includes the last activity date" do
expect(helper.project_list_cache_key(project)).to include(project.last_activity_date)
end
it "includes the controller name" do
expect(helper.controller).to receive(:controller_name).and_return("testcontroller")
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment