Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 06:08:53 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 06:08:53 +0300
commitccaa94488202341c25d24f6f16a70a9f658fc742 (patch)
tree886b8d0d4c14585243f3ccb439057e19f1860767 /app/services/error_tracking
parentd65442b1d9621da6749d59ea1a544a2ea39b3a79 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/error_tracking')
-rw-r--r--app/services/error_tracking/issue_update_service.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/app/services/error_tracking/issue_update_service.rb b/app/services/error_tracking/issue_update_service.rb
index db754d54fef..8c9d52cefd9 100644
--- a/app/services/error_tracking/issue_update_service.rb
+++ b/app/services/error_tracking/issue_update_service.rb
@@ -2,6 +2,8 @@
module ErrorTracking
class IssueUpdateService < ErrorTracking::BaseService
+ include ::Gitlab::Utils::StrongMemoize
+
private
def perform
@@ -9,6 +11,7 @@ module ErrorTracking
unless parse_errors(response).present?
response[:closed_issue_iid] = update_related_issue&.iid
+ project_error_tracking_setting.expire_issues_cache
end
response
@@ -22,10 +25,9 @@ module ErrorTracking
end
def update_related_issue
- issue = related_issue
- return unless issue
+ return if related_issue.nil?
- close_and_create_note(issue)
+ close_and_create_note(related_issue)
end
def close_and_create_note(issue)
@@ -49,10 +51,12 @@ module ErrorTracking
end
def related_issue
- SentryIssueFinder
- .new(project, current_user: current_user)
- .execute(params[:issue_id])
- &.issue
+ strong_memoize(:related_issue) do
+ SentryIssueFinder
+ .new(project, current_user: current_user)
+ .execute(params[:issue_id])
+ &.issue
+ end
end
def resolving?