Fix nbi devices task timeout
This commit is contained in:
1 parent
3f0d1f43eb
commit
261e556294
1 file changed
+2
-1
+2
-1
@@ -283,7 +283,8 @@ listener = (request, response) ->
|
|||||||
response.writeHead(202, err.message, {'Content-Type' : 'application/json'})
|
response.writeHead(202, err.message, {'Content-Type' : 'application/json'})
|
||||||
response.end(JSON.stringify(task))
|
response.end(JSON.stringify(task))
|
||||||
else
|
else
|
||||||
apiFunctions.watchTask(deviceId, task._id, config.get('DEVICE_ONLINE_THRESHOLD', deviceId), (err, status) ->
|
taskTimeout = urlParts.query.timeout? and parseInt(urlParts.query.timeout) or config.get('DEVICE_ONLINE_THRESHOLD', deviceId)
|
||||||
|
apiFunctions.watchTask(deviceId, task._id, taskTimeout, (err, status) ->
|
||||||
return throwError(err, response) if err
|
return throwError(err, response) if err
|
||||||
|
|
||||||
if status is 'timeout'
|
if status is 'timeout'
|
||||||
|
|||||||
Reference in new issue
Block a user