Skip to content
Snippets Groups Projects

Update epic cache counts on project/group deletion

Merged Jan Provaznik requested to merge jp-cached-issue-weight-worker2 into master
All threads resolved!
Compare and Show latest version
6 files
+ 57
22
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 7
5
@@ -179,6 +179,7 @@ def etag_caching_enabled?
after_commit do
::Epics::UpdateIssueCachedMetadataWorker.perform_async(parent_id) if propagate_issue_metadata_change?
::Epics::UpdateIssueCachedMetadataWorker.perform_async(parent_id_was) if parent_id_was && parent_id_was != parent_id
end
def epic_tree_root?
@@ -342,8 +343,6 @@ def search(query)
end
def ids_for_base_and_decendants(epic_ids)
return self.class.none unless parent_id
::Gitlab::ObjectHierarchy.new(self.id_in(epic_ids)).base_and_descendants.pluck(:id)
end
@@ -559,6 +558,8 @@ def level_depth_exceeded?(parent_epic)
private :level_depth_exceeded?
def base_and_ancestors
return self.class.none unless parent_id
hierarchy.base_and_ancestors(hierarchy_order: :asc)
end
@@ -670,10 +671,11 @@ def issues_weight_and_count
def propagate_issue_metadata_change?
return false unless parent_id
cached_attrs = %w(total_opened_issue_weight total_closed_issue_weight
total_opened_issue_count total_closed_issue_count)
attrs = %w(total_opened_issue_weight total_closed_issue_weight
total_opened_issue_count total_closed_issue_count
parent_id)
(previous_changes.keys & cached_attrs).any?
(previous_changes.keys & attrs).any?
end
end
end
Loading