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:
Diffstat (limited to 'app/workers/pages/invalidate_domain_cache_worker.rb')
-rw-r--r--app/workers/pages/invalidate_domain_cache_worker.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/workers/pages/invalidate_domain_cache_worker.rb b/app/workers/pages/invalidate_domain_cache_worker.rb
index 97e8966b342..1700b681b94 100644
--- a/app/workers/pages/invalidate_domain_cache_worker.rb
+++ b/app/workers/pages/invalidate_domain_cache_worker.rb
@@ -9,9 +9,9 @@ module Pages
feature_category :pages
def handle_event(event)
- if event.data[:project_id]
+ domain_ids(event).each do |domain_id|
::Gitlab::Pages::CacheControl
- .for_project(event.data[:project_id])
+ .for_domain(domain_id)
.clear_cache
end
@@ -25,5 +25,13 @@ module Pages
.clear_cache
end
end
+
+ def domain_ids(event)
+ ids = PagesDomain.ids_for_project(event.data[:project_id])
+
+ ids << event.data[:domain_id] if event.data[:domain_id]
+
+ ids
+ end
end
end