Skip to content

Commit

Permalink
Merge pull request #60 from bzwei/auto_load
Browse files Browse the repository at this point in the history
Don't eager load code on boot
  • Loading branch information
gmcculloug authored Mar 13, 2019
2 parents fd5f8b2 + 3bc2017 commit e2af5f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class Application < Rails::Application
# Skip views, helpers and assets when generating a new resource.
config.api_only = true

# Disabling eagerload in production in favor of autoload
config.autoload_paths += config.eager_load_paths

config.autoload_paths << Rails.root.join("app", "controllers", "mixins").to_s

ManageIQ::API::Common::Logging.activate(config)
Expand Down
8 changes: 6 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
# Code is not reloaded between requests.
config.cache_classes = true

# Eager load code on boot. This eager loads most of Rails and
# Don't eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true

# Enabling eagerloading also disables autoloading which causes problems
# in production that don't happen in development.
config.eager_load_paths = []
config.eager_load = false

# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
Expand Down

0 comments on commit e2af5f9

Please sign in to comment.