Welcome to mirror list, hosted at ThFree Co, Russian Federation.

invalidate_domain_cache_worker.rb « pages « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63b6f5c05b5fef49b8064d070e7c53c0283581cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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