Make RPC timeout configurable, and longer by default

This commit is contained in:
moneromooo 2017-09-14 10:33:56 +01:00
parent da965ebc69
commit ab6a2d60eb
2 changed files with 3 additions and 2 deletions

View file

@ -28,6 +28,7 @@ payment_confirmations = 6
tipbot_balance_cache_time = 35 # seconds
site_game_salt = ''
openalias_address = None
rpc_timeout = 180
admins = ["freenode:moneromooo", "freenode:moneromoo"]

View file

@ -215,7 +215,7 @@ def StringToUnits(s):
def SendJSONRPCCommand(host,port,method,params):
try:
http = httplib.HTTPConnection(host,port,timeout=20)
http = httplib.HTTPConnection(host,port,timeout=config.rpc_timeout)
except Exception,e:
log_error('SendJSONRPCCommand: Error connecting to %s:%u: %s' % (host, port, str(e)))
raise
@ -252,7 +252,7 @@ def SendJSONRPCCommand(host,port,method,params):
def SendHTMLCommand(host,port,method):
try:
http = httplib.HTTPConnection(host,port,timeout=20)
http = httplib.HTTPConnection(host,port,timeout=config.rpc_timeout)
except Exception,e:
log_error('SendHTMLCommand: Error connecting to %s:%u: %s' % (host, port, str(e)))
raise