From 1beb8727103590e5814a0b29e35d45cb7f5bee96 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Sun, 20 Dec 2015 02:14:35 +0300 Subject: [PATCH] Fix bug causing constant refreshing of custom commands --- lib/cwmp.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cwmp.coffee b/lib/cwmp.coffee index f0bcdf1..c0729c1 100644 --- a/lib/cwmp.coffee +++ b/lib/cwmp.coffee @@ -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]