work in process
This commit is contained in:
parent
8c1e64a080
commit
8821043ed7
4 changed files with 18 additions and 3 deletions
|
|
@ -23,6 +23,9 @@ 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
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
require File.join(Rails.root, 'app', 'models', 'jobs', 'base')
|
||||
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'
|
||||
|
||||
begin
|
||||
if Diaspora::Application.config.work_in_process
|
||||
module Resque
|
||||
def enqueue(klass, *args)
|
||||
klass.send(:perform, *args)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ if [ -n "$services" ]; then
|
|||
exit 64
|
||||
fi
|
||||
|
||||
|
||||
redis_config
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue