mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
forking in passenger was bust, message bus subscriptions would stop working after fork
This commit is contained in:
@ -16,7 +16,7 @@ GIT
|
|||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/SamSaffron/message_bus
|
remote: https://github.com/SamSaffron/message_bus
|
||||||
revision: f55b41653d0c149938ebb803a97d946e5ae80439
|
revision: 9c16e7ebaafaf2a3933a84fa1c517c0eba44b052
|
||||||
specs:
|
specs:
|
||||||
message_bus (0.0.2)
|
message_bus (0.0.2)
|
||||||
eventmachine
|
eventmachine
|
||||||
|
@ -13,6 +13,7 @@ if defined?(PhusionPassenger)
|
|||||||
# We're in smart spawning mode.
|
# We're in smart spawning mode.
|
||||||
$redis = DiscourseRedis.new
|
$redis = DiscourseRedis.new
|
||||||
Discourse::Application.config.cache_store.reconnect
|
Discourse::Application.config.cache_store.reconnect
|
||||||
|
MessageBus.after_fork
|
||||||
else
|
else
|
||||||
# We're in conservative spawning mode. We don't need to do anything.
|
# We're in conservative spawning mode. We don't need to do anything.
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# spring binstub rspec
|
# spring binstub rspec
|
||||||
Spring.after_fork do
|
Spring.after_fork do
|
||||||
$redis.client.reconnect
|
$redis.client.reconnect
|
||||||
MessageBus.reliable_pub_sub.pub_redis.client.reconnect
|
|
||||||
Rails.cache.reconnect
|
Rails.cache.reconnect
|
||||||
|
MessageBus.after_fork
|
||||||
end
|
end
|
||||||
Spring::Commands::Rake.environment_matchers["spec"] = "test"
|
Spring::Commands::Rake.environment_matchers["spec"] = "test"
|
||||||
|
@ -112,8 +112,8 @@ end
|
|||||||
Spork.each_run do
|
Spork.each_run do
|
||||||
# This code will be run each time you run your specs.
|
# This code will be run each time you run your specs.
|
||||||
$redis.client.reconnect
|
$redis.client.reconnect
|
||||||
MessageBus.reliable_pub_sub.pub_redis.client.reconnect
|
|
||||||
Rails.cache.reconnect
|
Rails.cache.reconnect
|
||||||
|
MessageBus.after_fork
|
||||||
end
|
end
|
||||||
|
|
||||||
def build(*args)
|
def build(*args)
|
||||||
|
Reference in New Issue
Block a user