forking in passenger was bust, message bus subscriptions would stop working after fork

This commit is contained in:
Sam 2013-06-03 16:50:30 +10:00
parent 978bc0ca4e
commit 8b69ee26ff
4 changed files with 4 additions and 3 deletions

View file

@ -16,7 +16,7 @@ GIT
GIT
remote: https://github.com/SamSaffron/message_bus
revision: f55b41653d0c149938ebb803a97d946e5ae80439
revision: 9c16e7ebaafaf2a3933a84fa1c517c0eba44b052
specs:
message_bus (0.0.2)
eventmachine

View file

@ -13,6 +13,7 @@ if defined?(PhusionPassenger)
# We're in smart spawning mode.
$redis = DiscourseRedis.new
Discourse::Application.config.cache_store.reconnect
MessageBus.after_fork
else
# We're in conservative spawning mode. We don't need to do anything.
end

View file

@ -7,7 +7,7 @@
# spring binstub rspec
Spring.after_fork do
$redis.client.reconnect
MessageBus.reliable_pub_sub.pub_redis.client.reconnect
Rails.cache.reconnect
MessageBus.after_fork
end
Spring::Commands::Rake.environment_matchers["spec"] = "test"

View file

@ -112,8 +112,8 @@ end
Spork.each_run do
# This code will be run each time you run your specs.
$redis.client.reconnect
MessageBus.reliable_pub_sub.pub_redis.client.reconnect
Rails.cache.reconnect
MessageBus.after_fork
end
def build(*args)