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

Accept write_timeout configuration, and supply it along to savoy #587

Merged
Merged
Show file tree
Hide file tree
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: 13 additions & 0 deletions lib/netsuite/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def connection(params={}, credentials={}, soap_header_extra_info={})
endpoint: endpoint,
read_timeout: read_timeout,
open_timeout: open_timeout,
write_timeout: write_timeout,
namespaces: namespaces,
soap_header: auth_header(credentials).update(soap_header).merge(soap_header_extra_info),
pretty_print_xml: true,
Expand Down Expand Up @@ -365,6 +366,18 @@ def open_timeout(timeout = nil)
end
end

def write_timeout=(timeout)
attributes[:write_timeout] = timeout
end

def write_timeout(timeout = nil)
if timeout
self.write_timeout = timeout
else
attributes[:write_timeout]
end
end

def log=(path)
attributes[:log] = path
end
Expand Down
3 changes: 3 additions & 0 deletions spec/netsuite/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,17 @@
it 'has defaults' do
expect(config.read_timeout).to eql(60)
expect(config.open_timeout).to be_nil
expect(config.write_timeout).to be_nil
end

it 'sets timeouts' do
config.read_timeout = 100
config.open_timeout = 60
config.write_timeout = 14

expect(config.read_timeout).to eql(100)
expect(config.open_timeout).to eql(60)
expect(config.write_timeout).to eql(14)

# ensure no exception is raised
config.connection
Expand Down
Loading