From c791ca7bc23ebc26a5a39c57f36f9e9b8434fa1f Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 15 Jun 2017 21:36:23 +0800 Subject: [PATCH] Use the same way to invalidate cache in EE Because it doesn't really hurt and could reduce conflicts Discussion: https://gitlab.com/gitlab-org/gitlab-ee/commit/5020e1a779cecbf16fffa3b37726b9167093126c#note_32403646 --- app/services/issuable_base_service.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb index a65d6e11c47..cd4d180824f 100644 --- a/app/services/issuable_base_service.rb +++ b/app/services/issuable_base_service.rb @@ -236,8 +236,9 @@ class IssuableBaseService < BaseService ) if old_assignees != issuable.assignees - assignees = old_assignees + issuable.assignees.to_a - invalidate_cache_counts(assignees.compact, issuable) + new_assignees = issuable.assignees.to_a + affected_assignees = (old_assignees + new_assignees) - (old_assignees & new_assignees) + invalidate_cache_counts(affected_assignees.compact, issuable) end after_update(issuable)