diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
commit | b595cb0c1dec83de5bdee18284abe86614bed33b (patch) | |
tree | 8c3d4540f193c5ff98019352f554e921b3a41a72 /app/workers/pages | |
parent | 2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff) |
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'app/workers/pages')
-rw-r--r-- | app/workers/pages/invalidate_domain_cache_worker.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/workers/pages/invalidate_domain_cache_worker.rb b/app/workers/pages/invalidate_domain_cache_worker.rb new file mode 100644 index 00000000000..63b6f5c05b5 --- /dev/null +++ b/app/workers/pages/invalidate_domain_cache_worker.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Pages + class InvalidateDomainCacheWorker + include Gitlab::EventStore::Subscriber + + idempotent! + + feature_category :pages + + def handle_event(event) + if event.data[:project_id] + ::Gitlab::Pages::CacheControl + .for_project(event.data[:project_id]) + .clear_cache + end + + if event.data[:root_namespace_id] + ::Gitlab::Pages::CacheControl + .for_namespace(event.data[:root_namespace_id]) + .clear_cache + end + end + end +end |