mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 13:38:49 +08:00
PERF: Stop running bootsnap in development mode on all environments (#25737)
Why this change? For some reason, we were setting up bootsnap manually even though the official documentation suggests requiring `bootsnap/setup` which will setup bootsnap using the default configuration. Because we were calling `Bootsnap.setup` manually, we did not set the `development_mode` option which defaults to `true`. Hence, we were running bootsnap in development mode even in the production environment which I suppose is not ideal. What does this change do? Instead of calling `Bootsnap.setup` manually, we can just use `require 'bootsnap/setup' instead.`
This commit is contained in:
parent
fc9648578b
commit
bdd91b3928
|
@ -14,19 +14,10 @@ require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
||||||
|
|
||||||
if (ENV["DISABLE_BOOTSNAP"] != "1")
|
if (ENV["DISABLE_BOOTSNAP"] != "1")
|
||||||
begin
|
begin
|
||||||
require "bootsnap"
|
require "bootsnap/setup"
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
# not a strong requirement
|
# not a strong requirement
|
||||||
end
|
end
|
||||||
|
|
||||||
if defined?(Bootsnap)
|
|
||||||
Bootsnap.setup(
|
|
||||||
cache_dir: "tmp/cache", # Path to your cache
|
|
||||||
load_path_cache: true, # Should we optimize the LOAD_PATH with a cache?
|
|
||||||
compile_cache_iseq: true, # Should compile Ruby code into ISeq cache?
|
|
||||||
compile_cache_yaml: false, # Skip YAML cache for now, cause we were seeing issues with it
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Parallel spec system
|
# Parallel spec system
|
||||||
|
|
Loading…
Reference in New Issue
Block a user