Fix bug causing constant refreshing of custom commands

This commit is contained in:
Zaid Abdulla committed 2015-12-20 02:14:35 +03:00
1 parent 1362eb4cd9
commit 3eb89e5dc6
1 file changed
+1 -1
+1 -1
View File
@@ -185,7 +185,7 @@ inform = (currentRequest, cwmpRequest) ->
deviceCustomCommands[k] = v._timestamp for k,v of device._customCommands
for cmd in customCommands.getDeviceCustomCommandNames(currentRequest.session.deviceId)
if not (deviceCustomCommands[cmd]?._timestamp < lastBootstrap)
if not deviceCustomCommands[cmd]? or deviceCustomCommands[cmd] < lastBootstrap
# Increment timestamp by one millisecond to ensure it runs after any refresh task
_tasks.push({device: currentRequest.session.deviceId, name: 'customCommand', command: "#{cmd} init", timestamp: new Date(now.getTime() + 1)})
delete deviceCustomCommands[cmd]