Fix bug where faults in new devices never get saved

This commit is contained in:
Zaid Abdulla committed 2016-09-12 02:26:04 -07:00
1 parent b7370a6fb9
commit a254ebbe0c
1 file changed
+1 -1
+1 -1
View File
@@ -683,7 +683,7 @@ syncFaults = (deviceId, faults, callback) ->
) )
for channel, fault of faults for channel, fault of faults
continue if fault.retries == existingFaults[channel]?.retries continue if existingFaults[channel]? and fault.retries == existingFaults[channel].retries
do (channel, fault) -> do (channel, fault) ->
++ counter ++ counter
fault._id = "#{deviceId}:#{channel}" fault._id = "#{deviceId}:#{channel}"