summaryrefslogtreecommitdiff
path: root/app/models/pages_domain.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/pages_domain.rb')
-rw-r--r--app/models/pages_domain.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index 856496f0941..d071d2d3c89 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -3,6 +3,7 @@
class PagesDomain < ApplicationRecord
include Presentable
include FromUnion
+ include AfterCommitQueue
VERIFICATION_KEY = 'gitlab-pages-verification-code'
VERIFICATION_THRESHOLD = 3.days.freeze
@@ -222,6 +223,8 @@ class PagesDomain < ApplicationRecord
private
def pages_deployed?
+ return false unless project
+
# TODO: remove once `pages_metadatum` is migrated
# https://gitlab.com/gitlab-org/gitlab/issues/33106
unless project.pages_metadatum
@@ -244,8 +247,13 @@ class PagesDomain < ApplicationRecord
# rubocop: disable CodeReuse/ServiceClass
def update_daemon
return if usage_serverless?
+ return unless pages_deployed?
- ::Projects::UpdatePagesConfigurationService.new(project).execute
+ if Feature.enabled?(:async_update_pages_config, project)
+ run_after_commit { PagesUpdateConfigurationWorker.perform_async(project_id) }
+ else
+ Projects::UpdatePagesConfigurationService.new(project).execute
+ end
end
# rubocop: enable CodeReuse/ServiceClass