summaryrefslogtreecommitdiff
path: root/app/workers/reactive_caching_worker.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/workers/reactive_caching_worker.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/workers/reactive_caching_worker.rb')
-rw-r--r--app/workers/reactive_caching_worker.rb32
1 files changed, 2 insertions, 30 deletions
diff --git a/app/workers/reactive_caching_worker.rb b/app/workers/reactive_caching_worker.rb
index 513033281e5..a0829c31280 100644
--- a/app/workers/reactive_caching_worker.rb
+++ b/app/workers/reactive_caching_worker.rb
@@ -1,36 +1,8 @@
# frozen_string_literal: true
class ReactiveCachingWorker # rubocop:disable Scalability/IdempotentWorker
- include ApplicationWorker
+ include ReactiveCacheableWorker
- feature_category_not_owned!
-
- # TODO: The reactive caching worker should be split into
- # two different workers, one for high urgency jobs without external dependencies
- # and another worker without high urgency, but with external dependencies
- # https://gitlab.com/gitlab-com/gl-infra/scalability/issues/34
- # This worker should also have `worker_has_external_dependencies!` enabled
- urgency :high
+ urgency :low
worker_resource_boundary :cpu
-
- def self.context_for_arguments(arguments)
- class_name, *_other_args = arguments
- Gitlab::ApplicationContext.new(related_class: class_name.to_s)
- end
-
- def perform(class_name, id, *args)
- klass = begin
- class_name.constantize
- rescue NameError
- nil
- end
- return unless klass
-
- klass
- .reactive_cache_worker_finder
- .call(id, *args)
- .try(:exclusively_update_reactive_cache!, *args)
- rescue ReactiveCaching::ExceededReactiveCacheLimit => e
- Gitlab::ErrorTracking.track_exception(e)
- end
end