mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Check Zeitwerk eager loading in GitHub CI (#20699)
In production, `eager_load=true`. This sometimes leads to boot errors which are not present in dev/test environments. Running `zeitwerk:check` in CI will help us to pick up on any errors early. This commit also introduces a `DISCOURSE_ZEITWERK_EAGER_LOAD` environment variable to make it easier to toggle the behaviour when developing locally.
This commit is contained in:
@@ -9,7 +9,7 @@ Discourse::Application.configure do
|
||||
config.cache_classes = false
|
||||
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
||||
|
||||
config.eager_load = false
|
||||
config.eager_load = ENV["DISCOURSE_ZEITWERK_EAGER_LOAD"] == "1"
|
||||
|
||||
# Use the schema_cache.yml file generated during db:migrate (via db:schema:cache:dump)
|
||||
config.active_record.use_schema_cache_dump = true
|
||||
|
||||
@@ -44,7 +44,7 @@ Discourse::Application.configure do
|
||||
config.assets.compile = true
|
||||
config.assets.digest = false
|
||||
|
||||
config.eager_load = false
|
||||
config.eager_load = ENV["DISCOURSE_ZEITWERK_EAGER_LOAD"] == "1"
|
||||
|
||||
if ENV["RAILS_ENABLE_TEST_LOG"]
|
||||
config.logger = Logger.new(STDOUT)
|
||||
|
||||
Reference in New Issue
Block a user