Skip to content
Snippets Groups Projects
Commit 67f33e73 authored by Mandeep Dhami's avatar Mandeep Dhami
Browse files

Update for BSC-2285 (Corrupted device index)

parent c467d6d7
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,15 @@ public abstract class DeviceIndex {
IndexedEntity oio = new IndexedEntity(keyFields, o);
if (oio.equals(ie)) return;
}
removeEntity(entity, deviceKey);
Iterator<Long> keyiter = this.queryByEntity(entity);
while (keyiter.hasNext()) {
Long key = keyiter.next();
if (key.equals(deviceKey)) {
removeEntity(entity, deviceKey);
break;
}
}
}
}
\ No newline at end of file
}
......@@ -1162,7 +1162,14 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
if (deleteQueue != null) {
for (Long l : deleteQueue) {
Device dev = deviceMap.get(l);
this.deleteDevice(dev);
deviceMap.remove(l);
// generate new device update
deviceUpdates =
updateUpdates(deviceUpdates,
new DeviceUpdate(dev, DELETE, null));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment