PERF: add FORCE_BOOTSNAP env var

Bootsnap is designed to work in production per:
https://github.com/Shopify/bootsnap

Over the years we have seen very few issues with it, none of which
were corruption.

This allows us to enable bootsnap in production

Having bootsnap enabled means that we can speed up deploys by
about 5 seconds per server. It also means a lot less waiting for
various production rake tasks and so on.
This commit is contained in:
Sam Saffron
2020-06-03 15:18:32 +10:00
parent 04a291ceea
commit cbaad631a4

View File

@@ -12,7 +12,7 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
if ENV['RAILS_ENV'] != 'production' && ENV['RAILS_ENV'] != 'profile'
if (ENV['FORCE_BOOTSNAP'] == '1') || (ENV['RAILS_ENV'] != 'production' && ENV['RAILS_ENV'] != 'profile')
begin
require 'bootsnap'
rescue LoadError