Skip to content

Commit

Permalink
[#168] open_timeout and read_timeout are commented out in generated c…
Browse files Browse the repository at this point in the history
…onfig files
  • Loading branch information
alindeman committed Jan 28, 2012
1 parent 7f9252d commit 437f293
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions sunspot/lib/sunspot/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ def batch
# RSolr::Connection::Base:: The connection for this session
#
def connection
args =
@connection ||=
self.class.connection_class.connect(:url => config.solr.url, :read_timeout=>config.solr.read_timeout, :open_timeout=>config.solr.open_timeout)
self.class.connection_class.connect(:url => config.solr.url,
:read_timeout => config.solr.read_timeout,
:open_timeout => config.solr.open_timeout)
end

def indexer
Expand Down
2 changes: 2 additions & 0 deletions sunspot/spec/api/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@
Sunspot.commit
connection.opts[:url].should == 'http://127.0.0.1:8981/solr'
end

it 'should open a connection with custom read timeout' do
Sunspot.config.solr.read_timeout = 0.5
Sunspot.commit
connection.opts[:read_timeout].should == 0.5
end

it 'should open a connection with custom open timeout' do
Sunspot.config.solr.open_timeout = 0.5
Sunspot.commit
Expand Down
6 changes: 3 additions & 3 deletions sunspot_rails/generators/sunspot/templates/sunspot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ production:
hostname: localhost
port: 8983
log_level: WARNING
read_timeout: 2
open_timeout: 0.5
# read_timeout: 2
# open_timeout: 0.5

development:
solr:
Expand All @@ -17,4 +17,4 @@ test:
hostname: localhost
port: 8981
log_level: WARNING


Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ production:
hostname: localhost
port: 8983
log_level: WARNING
read_timeout: 2
open_timeout: 0.5
# read_timeout: 2
# open_timeout: 0.5

development:
solr:
Expand All @@ -16,4 +16,4 @@ test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
log_level: WARNING

0 comments on commit 437f293

Please sign in to comment.