diff options
author | Robert Speicher <robert@gitlab.com> | 2017-09-01 21:39:12 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-09-01 21:39:12 +0300 |
commit | dd825c0f5d00cef3cac89480bcf2027064c5d89d (patch) | |
tree | 70ea0d2a238516e9b082bbce487ed6ea66b836a7 /app/services | |
parent | 6fffddab70825f5a0b63be39de0d332a79d42479 (diff) | |
parent | e7817fc1e0877efd59f0442934bbb0ad91fbb20a (diff) |
Merge branch 'remove-finder-caching' into 'master'
Remove issuable finder count caching
See merge request !13959
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/issuable_base_service.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb index 7679389faf6..8b967b78052 100644 --- a/app/services/issuable_base_service.rb +++ b/app/services/issuable_base_service.rb @@ -245,9 +245,7 @@ class IssuableBaseService < BaseService new_assignees = issuable.assignees.to_a affected_assignees = (old_assignees + new_assignees) - (old_assignees & new_assignees) - # Don't clear the project cache, because it will be handled by the - # appropriate service (close / reopen / merge / etc.). - invalidate_cache_counts(issuable, users: affected_assignees.compact, skip_project_cache: true) + invalidate_cache_counts(issuable, users: affected_assignees.compact) after_update(issuable) issuable.create_new_cross_references!(current_user) execute_hooks(issuable, 'update') @@ -341,18 +339,9 @@ class IssuableBaseService < BaseService create_labels_note(issuable, old_labels) if issuable.labels != old_labels end - def invalidate_cache_counts(issuable, users: [], skip_project_cache: false) + def invalidate_cache_counts(issuable, users: []) users.each do |user| user.public_send("invalidate_#{issuable.model_name.singular}_cache_counts") # rubocop:disable GitlabSecurity/PublicSend end - - unless skip_project_cache - case issuable - when Issue - IssuesFinder.new(nil, project_id: issuable.project_id).clear_caches! - when MergeRequest - MergeRequestsFinder.new(nil, project_id: issuable.target_project_id).clear_caches! - end - end end end |