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/services/projects/update_pages_configuration_service.rb')
-rw-r--r--app/services/projects/update_pages_configuration_service.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/services/projects/update_pages_configuration_service.rb b/app/services/projects/update_pages_configuration_service.rb
index 674071ad92a..88c17d502df 100644
--- a/app/services/projects/update_pages_configuration_service.rb
+++ b/app/services/projects/update_pages_configuration_service.rb
@@ -11,15 +11,20 @@ module Projects
end
def execute
- if file_equals?(pages_config_file, pages_config_json)
- return success(reload: false)
+ # If the pages were never deployed, we can't write out the config, as the
+ # directory would not exist.
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/235139
+ return success unless project.pages_deployed?
+
+ unless file_equals?(pages_config_file, pages_config_json)
+ update_file(pages_config_file, pages_config_json)
+ reload_daemon
end
- update_file(pages_config_file, pages_config_json)
- reload_daemon
- success(reload: true)
+ success
rescue => e
- error(e.message)
+ Gitlab::ErrorTracking.track_exception(e)
+ error(e.message, pass_back: { exception: e })
end
private