Configurable connection request timeout

This commit is contained in:
Zaid Abdulla committed 2017-02-12 02:37:00 -08:00
1 parent 8e34c6a2f6
commit 595c318720
2 files changed
+3 -1

No files matched your search

+2 -1
View File
@@ -136,6 +136,7 @@ httpConReq = (url, username, password, timeout, callback) ->
connectionRequest = (deviceId, callback) -> connectionRequest = (deviceId, callback) ->
CONNECTION_REQUEST_TIMEOUT = config.get('CONNECTION_REQUEST_TIMEOUT', deviceId)
proj = { proj = {
'Device.ManagementServer.ConnectionRequestURL._value' : 1, 'Device.ManagementServer.ConnectionRequestURL._value' : 1,
'Device.ManagementServer.UDPConnectionRequestAddress._value' : 1, 'Device.ManagementServer.UDPConnectionRequestAddress._value' : 1,
@@ -165,7 +166,7 @@ connectionRequest = (deviceId, callback) ->
if udpConnectionRequestAddress if udpConnectionRequestAddress
udpConReq(udpConnectionRequestAddress, username, password, (err) -> throw err if err) udpConReq(udpConnectionRequestAddress, username, password, (err) -> throw err if err)
httpConReq(connectionRequestUrl, username, password, 2000, (err) -> httpConReq(connectionRequestUrl, username, password, CONNECTION_REQUEST_TIMEOUT, (err) ->
if udpConnectionRequestAddress if udpConnectionRequestAddress
return callback() return callback()
callback(err) callback(err)
+1
View File
@@ -48,6 +48,7 @@ options = {
DEBUG : {type : 'bool', default : false}, DEBUG : {type : 'bool', default : false},
RETRY_DELAY : {type : 'int', default : 300}, RETRY_DELAY : {type : 'int', default : 300},
SESSION_TIMEOUT : {type : 'int', default : 30}, SESSION_TIMEOUT : {type : 'int', default : 30},
CONNECTION_REQUEST_TIMEOUT : {type : 'int', default: 2000},
GET_PARAMETER_NAMES_DEPTH_THRESHOLD : {type : 'int', default : 0}, GET_PARAMETER_NAMES_DEPTH_THRESHOLD : {type : 'int', default : 0},
TASK_PARAMETERS_BATCH_SIZE : {type : 'int', default : 32}, TASK_PARAMETERS_BATCH_SIZE : {type : 'int', default : 32},
MAX_DEPTH : {type: 'int', default : 16}, MAX_DEPTH : {type: 'int', default : 16},