From 7922e6bfc05e434a152ef79d7574b3815329be5d Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 6 Jan 2025 17:43:44 +1100 Subject: [PATCH] DEV: Restart unicorn when any settings.yml changes. (#30577) This change expands the matcher added in 02bebb7e9152996d86b980baea73eacb5d9222ef to include plugin `settings.yml` files as requiring a server restart when they change. The `Listen.to(only: ...)` filter only matches against filenames (as opposed to full paths) so we can't add a matcher against `plugins/.*/config/settings.yml` to make it explicit. --- config/initializers/000-development_reload_warnings.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/000-development_reload_warnings.rb b/config/initializers/000-development_reload_warnings.rb index 7d81f417b89..78f5661b3c6 100644 --- a/config/initializers/000-development_reload_warnings.rb +++ b/config/initializers/000-development_reload_warnings.rb @@ -29,7 +29,8 @@ if Rails.env.development? && !Rails.configuration.cache_classes && Discourse.run Listen .to( *paths, - only: /\.rb|site_settings.yml$/, + # Aside from .rb files, this will also match site_settings.yml, as well as any plugin settings.yml files. + only: /(\.rb|settings.yml)$/, ignore: [/node_modules/], ) do |modified, added, removed| supervisor_pid = UNICORN_DEV_SUPERVISOR_PID