diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-09 00:06:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-09 00:06:38 +0300 |
commit | ae72d71da85732ec9ceb9723953fe6ca1df0fdf6 (patch) | |
tree | 9e1096312c5fc03a7657ae9586a6714f04ddf8ad /app/models/error_tracking | |
parent | 759bab058520a21d87087355dc193f634176e98a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/error_tracking')
-rw-r--r-- | app/models/error_tracking/project_error_tracking_setting.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/models/error_tracking/project_error_tracking_setting.rb b/app/models/error_tracking/project_error_tracking_setting.rb index 0b4fef5eac1..0fa19b1cedc 100644 --- a/app/models/error_tracking/project_error_tracking_setting.rb +++ b/app/models/error_tracking/project_error_tracking_setting.rb @@ -87,10 +87,30 @@ module ErrorTracking { projects: sentry_client.list_projects } end + def issue_details(opts = {}) + with_reactive_cache('issue_details', opts.stringify_keys) do |result| + result + end + end + + def issue_latest_event(opts = {}) + with_reactive_cache('issue_latest_event', opts.stringify_keys) do |result| + result + end + end + def calculate_reactive_cache(request, opts) case request when 'list_issues' { issues: sentry_client.list_issues(**opts.symbolize_keys) } + when 'issue_details' + { + issue: sentry_client.issue_details(**opts.symbolize_keys) + } + when 'issue_latest_event' + { + latest_event: sentry_client.issue_latest_event(**opts.symbolize_keys) + } end rescue Sentry::Client::Error => e { error: e.message, error_type: SENTRY_API_ERROR_TYPE_NON_20X_RESPONSE } |