From cbaad631a47a62b07be39da92eb8048dc2410299 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Wed, 3 Jun 2020 15:18:32 +1000 Subject: [PATCH] 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. --- config/boot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/boot.rb b/config/boot.rb index ae2ee5b2fab..affd36c9bb4 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -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