work in process

This commit is contained in:
danielgrippi 2011-05-16 17:47:27 -07:00
parent 8c1e64a080
commit 8821043ed7
4 changed files with 18 additions and 3 deletions

View file

@ -23,6 +23,9 @@ Diaspora::Application.configure do
config.active_support.deprecation = :log config.active_support.deprecation = :log
#config.threadsafe! #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 # 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 # 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 # 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

View file

@ -47,6 +47,10 @@ Diaspora::Application.configure do
# the I18n.default_locale when a translation can not be found) # the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true config.i18n.fallbacks = true
config.threadsafe! config.threadsafe!
# Process jobs in process?
#config.work_in_process = false
end end
# Sacrifice readability for a 10% performance boost # Sacrifice readability for a 10% performance boost

View file

@ -1,5 +1,14 @@
require File.join(Rails.root, 'app', 'models', 'jobs', 'base') require File.join(Rails.root, 'app', 'models', 'jobs', 'base')
Dir[File.join(Rails.root, 'app', 'models', 'jobs', '*.rb')].each { |file| require file } Dir[File.join(Rails.root, 'app', 'models', 'jobs', '*.rb')].each { |file| require file }
#config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))
#Resque.redis = Redis.new(:host => config['host'], :port => config['port'])
require 'resque' require 'resque'
begin
if Diaspora::Application.config.work_in_process
module Resque
def enqueue(klass, *args)
klass.send(:perform, *args)
end
end
end
end

View file

@ -121,7 +121,6 @@ if [ -n "$services" ]; then
exit 64 exit 64
fi fi
redis_config redis_config