diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 8d3c1ec47..393b6e53d 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -96,6 +96,9 @@ default: # It is false by default in development and test. enable_splunk_logging: true + # Process jobs in process? + single_process_mode: true + development: enable_splunk_logging: false @@ -105,3 +108,4 @@ test: enable_splunk_logging: false production: + single_process_mode: false diff --git a/config/environments/development.rb b/config/environments/development.rb index 8329de4eb..0051d171d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -23,9 +23,6 @@ Diaspora::Application.configure do config.active_support.deprecation = :log #config.threadsafe! - # Process jobs in process? - config.work_in_process = true - # Monkeypatch around the nasty "2.5MB exception page" issue, caused by very large environment vars # This snippet via: http://stackoverflow.com/questions/3114993/exception-pages-in-development-mode-take-upwards-of-15-30-seconds-to-render-why # Relevant Rails ticket: https://rails.lighthouseapp.com/projects/8994/tickets/5027-_request_and_responseerb-and-diagnosticserb-take-an-increasingly-long-time-to-render-in-development-with-multiple-show-tables-calls diff --git a/config/environments/production.rb b/config/environments/production.rb index d38457c5b..f02ea6132 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -47,10 +47,6 @@ Diaspora::Application.configure do # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true config.threadsafe! - - # Process jobs in process? - #config.work_in_process = false - end # Sacrifice readability for a 10% performance boost diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb index 22be0cec2..cc977ba6a 100644 --- a/config/initializers/resque.rb +++ b/config/initializers/resque.rb @@ -4,7 +4,7 @@ Dir[File.join(Rails.root, 'app', 'models', 'jobs', '*.rb')].each { |file| requir require 'resque' begin - if Diaspora::Application.config.work_in_process + if AppConfig[:single_process_mode] if Rails.env == 'production' puts "WARNING: You are running Diaspora in production without Resque workers turned on. Please don't do this." end