Commit 8a56fa9b authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'revert-dec0c7a9' into 'master'

Revert "Merge branch '197320-clear-cache-after-sentry-error-update' into 'master'"

See merge request gitlab-org/gitlab!24317
parents 3153edd5 e90cce11
......@@ -128,10 +128,6 @@ module ErrorTracking
end
end
def expire_issues_cache
Rails.cache.delete_matched(expand_cache_key('list_issues'))
end
# http://HOST/api/0/projects/ORG/PROJECT
# ->
# http://HOST/ORG/PROJECT
......@@ -148,12 +144,6 @@ module ErrorTracking
private
def expand_cache_key(resource_prefix)
klass_key = self.class.reactive_cache_key.call(self).join(':')
"#{klass_key}:#{resource_prefix}*"
end
def add_gitlab_issue_details(issue)
issue.gitlab_commit = match_gitlab_commit(issue.first_release_version)
issue.gitlab_commit_path = project_commit_path(project, issue.gitlab_commit) if issue.gitlab_commit
......
......@@ -2,8 +2,6 @@
module ErrorTracking
class IssueUpdateService < ErrorTracking::BaseService
include ::Gitlab::Utils::StrongMemoize
private
def perform
......@@ -14,14 +12,14 @@ module ErrorTracking
compose_response(response) do
response[:closed_issue_iid] = update_related_issue&.iid
project_error_tracking_setting.expire_issues_cache
end
end
def update_related_issue
return if related_issue.nil?
issue = related_issue
return unless issue
close_and_create_note(related_issue)
close_and_create_note(issue)
end
def close_and_create_note(issue)
......@@ -45,12 +43,10 @@ module ErrorTracking
end
def related_issue
strong_memoize(:related_issue) do
SentryIssueFinder
.new(project, current_user: current_user)
.execute(params[:issue_id])
&.issue
end
SentryIssueFinder
.new(project, current_user: current_user)
.execute(params[:issue_id])
&.issue
end
def resolving?
......
......@@ -440,18 +440,4 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
end
end
end
describe '#expire_issues_cache', :use_clean_rails_memory_store_caching do
it 'clears the cache' do
klass_key = subject.class.reactive_cache_key.call(subject).join(':')
key = "#{klass_key}:list_issues:some_suffix"
Rails.cache.write(key, 1)
expect(Rails.cache.exist?(key)).to eq(true)
subject.expire_issues_cache
expect(Rails.cache.exist?(key)).to eq(false)
end
end
end
......@@ -40,16 +40,6 @@ describe ErrorTracking::IssueUpdateService do
result
end
it 'clears the reactive cache' do
allow(error_tracking_setting)
.to receive(:expire_issues_cache)
result
expect(error_tracking_setting)
.to have_received(:expire_issues_cache)
end
context 'related issue and resolving' do
let(:issue) { create(:issue, project: project) }
let(:sentry_issue) { create(:sentry_issue, issue: issue) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment