Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Commit 86a83d2

Browse files
committed
Removing verify_connection config
- This was a old hack and isn't necessary anymore.
1 parent 1d04302 commit 86a83d2

File tree

4 files changed

+0
-21
lines changed

4 files changed

+0
-21
lines changed

README.mkdn

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ If you want to send a specified action, or all actions from a controller, to a s
122122
To see the complete list of features and syntax, please check out our <a href="http://wiki.github.com/tchandy/octopus/"> Wiki</a>
123123
Want to see sample rails applications using octopus features? please check it out: <a href="http://github.com/tchandy/octopus_sharding_example">Sharding Example</a> and <a href="http://github.com/tchandy/octopus_replication_example">Replication Example</a>. Also, we have an example that shows how to use Octopus without Rails: <a href="http://github.com/tchandy/octopus_sinatra"> Octopus + Sinatra Example</a>.
124124

125-
126-
## Important!
127-
Occasionally, an application might lose a connection to a database; when this happens, ActiveRecord will raise an exception. Add the following line to your application configuration if you are experiencing this issue:
128-
129-
verify_connection: true
130-
131-
This will tell Octopus to verify the connection before sending the query.
132-
133125
## Mixing Octopus with the Rails multiple database model
134126
If you want to set a custom connection to a specific model, use the syntax `octopus_establish_connection` syntax:
135127

lib/octopus/proxy.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ def initialize_shards(config)
1515
@shards[:master] = ActiveRecord::Base.connection_pool_without_octopus()
1616
@config = ActiveRecord::Base.connection_pool_without_octopus.connection.instance_variable_get(:@config)
1717

18-
if !config.nil? && config.has_key?("verify_connection")
19-
@verify_connection = config["verify_connection"]
20-
else
21-
@verify_connection = false
22-
end
23-
2418
if !config.nil?
2519
@entire_sharded = config['entire_sharded']
2620
shards_config = config[Octopus.rails_env()]
@@ -150,7 +144,6 @@ def safe_connection(connection_pool)
150144
end
151145

152146
def select_connection
153-
@shards[shard_name].verify_active_connections! if @verify_connection
154147
safe_connection(@shards[shard_name])
155148
end
156149

spec/config/shards.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ production_fully_replicated:
102102

103103
octopus_rails:
104104
replicated: true
105-
verify_connection: true
106105
environments:
107106
- staging
108107
- production

spec/octopus/proxy_spec.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
proxy.instance_variable_get(:@replicated).should be_false
2727
end
2828

29-
it "should not verify connections for default" do
30-
proxy.instance_variable_get(:@verify_connection).should be_false
31-
end
32-
3329
it "should work with thiking sphinx" do
3430
config = proxy.instance_variable_get(:@config)
3531
config[:adapter].should == "mysql2"
@@ -140,7 +136,6 @@
140136
Octopus.config()
141137

142138
proxy.instance_variable_get(:@replicated).should be_true
143-
proxy.instance_variable_get(:@verify_connection).should be_true
144139
Octopus.environments.should == ["staging", "production"]
145140
end
146141

0 commit comments

Comments
 (0)