Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue with HA console when ruby-debug is loaded #261

Merged
merged 1 commit into from
Jun 18, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/neo4j/rails/ha_console/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ module HaConsole
# It avoids the Neo4j limitation of only having one process accessing the database by using HA clustering/neo4j-enterprise
class Railtie < Object::Rails::Railtie

console do
Neo4j.config.use do |conf|
server_id = 2
conf['ha.server_id'] = server_id
conf['ha.server'] = "localhost:600#{server_id}"
conf['ha.cluster_server'] = "localhost:500#{server_id}"
conf['storage_path'] = File.expand_path("db/ha_neo_#{server_id}", Object::Rails.root)
puts "Re-Config HA cluster, ha.server_id: #{conf['ha.server_id']}, db: #{conf['storage_path']}"
end
end

config.before_configuration do
server_id = ((defined? IRB) || (defined? Pry)) ? 2 : 1
server_id = 1
config.neo4j['enable_ha'] = true
config.neo4j['ha.server_id'] = server_id
config.neo4j['ha.server'] = "localhost:600#{server_id}"
Expand Down