Permalink
Browse files

adding timeout configuration for requests between 'node to server' an…

…d 'server to node '

Server to node communication is supposed to be fast, always. But node/worker to server can be slow, very slow. So, if you have this issue with timeouts, you can configure how you want this.
  • Loading branch information...
1 parent 7707697 commit 0147a226d21b6ce9564b8c630b4bb78aeb01e4be @felipecvo felipecvo committed Aug 5, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/cloud-crowd.rb
View
@@ -133,7 +133,10 @@ def pid_path(pid_file=nil)
# a connection, and a timeout of 30 to finish reading it.
def client_options
return @client_options if @client_options
- @client_options = {:timeout => config[:timeout] || 30, :open_timeout => config[:open_timeout] || 5}
+ @client_options = {
+ :timeout => (self.server? ? config[:node_timeout] : config[:server_timeout]) || 30,
+ :open_timeout => config[:open_timeout] || 5
+ }
if CloudCrowd.config[:http_authentication]
@client_options[:user] = CloudCrowd.config[:login]
@client_options[:password] = CloudCrowd.config[:password]

0 comments on commit 0147a22

Please sign in to comment.