Commit 5757fa4d authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'sh-make-cache-classes-configurable' into 'master'

Make Rails code reloading configurable in development and test

See merge request gitlab-org/gitlab!46836
parents a81ebcd2 a4b050f5
...@@ -65,6 +65,7 @@ variables: ...@@ -65,6 +65,7 @@ variables:
ES_JAVA_OPTS: "-Xms256m -Xmx256m" ES_JAVA_OPTS: "-Xms256m -Xmx256m"
ELASTIC_URL: "http://elastic:changeme@elasticsearch:9200" ELASTIC_URL: "http://elastic:changeme@elasticsearch:9200"
DOCKER_VERSION: "19.03.0" DOCKER_VERSION: "19.03.0"
CACHE_CLASSES: "true"
# Preparing custom clone path to reduce space used by all random forks # Preparing custom clone path to reduce space used by all random forks
# on GitLab.com's Shared Runners. Our main forks - especially the security # on GitLab.com's Shared Runners. Our main forks - especially the security
......
...@@ -4,7 +4,7 @@ Rails.application.configure do ...@@ -4,7 +4,7 @@ Rails.application.configure do
# In the development environment your application's code is reloaded on # In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development # every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes. # since you don't have to restart the web server when you make code changes.
config.cache_classes = false config.cache_classes = Gitlab::Utils.to_boolean(ENV['CACHE_CLASSES'], default: false)
# Show full error reports and disable caching # Show full error reports and disable caching
config.active_record.verbose_query_logs = true config.active_record.verbose_query_logs = true
......
...@@ -17,9 +17,7 @@ Rails.application.configure do ...@@ -17,9 +17,7 @@ Rails.application.configure do
# test suite. You never need to work with it otherwise. Remember that # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped # your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there! # and recreated between test runs. Don't rely on the data there!
config.cache_classes = Gitlab::Utils.to_boolean(ENV['CACHE_CLASSES'], default: false)
# Code doesn't change in CI so we don't need code-reloading
config.cache_classes = !!ENV['CI']
# Configure static asset server for tests with Cache-Control for performance # Configure static asset server for tests with Cache-Control for performance
config.assets.compile = false if ENV['CI'] config.assets.compile = false if ENV['CI']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment