diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-12 21:12:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-12 21:12:20 +0300 |
commit | 60aef5496ecea447e860786fe391eb45d2cf61e5 (patch) | |
tree | a20fdcc01a8d384e8b6d9c9cc6f58ad3177070d7 /app/models/concerns/integrations | |
parent | 76cbe9e688549d47b0055573380b908cf9a72ed1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/integrations')
-rw-r--r-- | app/models/concerns/integrations/reactively_cached.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/concerns/integrations/reactively_cached.rb b/app/models/concerns/integrations/reactively_cached.rb new file mode 100644 index 00000000000..62eff06c8e2 --- /dev/null +++ b/app/models/concerns/integrations/reactively_cached.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Integrations + module ReactivelyCached + extend ActiveSupport::Concern + + included do + include ::ReactiveCaching + + # Default cache key: class name + project_id + self.reactive_cache_key = ->(integration) { [integration.class.model_name.singular, integration.project_id] } + self.reactive_cache_work_type = :external_dependency + end + end +end |