Skip to content

Commit

Permalink
incorporate max-execution-time
Browse files Browse the repository at this point in the history
  • Loading branch information
karabijavad committed Jan 15, 2014
1 parent e4e3e87 commit 7e63e2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/neography/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Config
:log_file, :log_enabled, :slow_log_threshold,
:max_threads,
:authentication, :username, :password,
:parser
:parser, :max_execution_time

def initialize
set_defaults
Expand All @@ -27,7 +27,8 @@ def to_hash
:authentication => @authentication,
:username => @username,
:password => @password,
:parser => @parser
:parser => @parser,
:max_execution_time => @max_execution_time
}
end

Expand All @@ -48,6 +49,7 @@ def set_defaults
@username = nil
@password = nil
@parser = MultiJsonParser
@max_execution_time = 6000
end

end
Expand Down
2 changes: 2 additions & 0 deletions lib/neography/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def merge_options(options)
merged_options = options.merge!(@authentication)
merged_options[:headers].merge!(@user_agent) if merged_options[:headers]
merged_options[:headers].merge!('X-Stream' => true) if merged_options[:headers]
merged_options[:headers].merge!(@max_execution_time) if merged_options[:headers]
merged_options
end

Expand Down Expand Up @@ -88,6 +89,7 @@ def save_local_configuration(config)
@max_threads = config[:max_threads]
@parser = config[:parser]

@max_execution_time = { 'max-execution-time' => config[:max_execution_time] }
@user_agent = { "User-Agent" => USER_AGENT }

@authentication = {}
Expand Down

0 comments on commit 7e63e2e

Please sign in to comment.