DEV: Do not auto reload on plugin spec file changes (#22127)

There is no need to reload the rails server if plugin spec
files change, since they are not autoloaded but they are also
not loaded into the app.
This commit is contained in:
Martin Brennan 2023-06-15 16:34:30 +10:00 committed by GitHub
parent c819c96c31
commit f3afc8bf85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,9 @@ if Rails.env.development? && !Rails.configuration.cache_classes && Discourse.run
not_autoloaded =
files.filter_map do |file|
autoloaded = Rails.autoloaders.main.__autoloads.key? file
Pathname.new(file).relative_path_from(Rails.root) if !autoloaded
if !autoloaded && !file.end_with?("spec.rb")
Pathname.new(file).relative_path_from(Rails.root)
end
end
if not_autoloaded.length > 0