fix(xo-server-usage-report): handle renamed VMs (#3)

This commit is contained in:
badrAZ 2017-03-08 09:56:45 +01:00 committed by Julien Fontanet
parent b03335eb94
commit 3662f4f256

View File

@ -4,10 +4,9 @@ import { CronJob } from 'cron'
import {
assign,
concat,
differenceWith,
differenceBy,
filter,
forEach,
isEqual,
isFinite,
map,
orderBy,
@ -170,8 +169,8 @@ function conputePercentage (curr, prev, options) {
function getDiff (oldElements, newElements) {
return {
added: differenceWith(oldElements, newElements, isEqual),
removed: differenceWith(newElements, oldElements, isEqual)
added: differenceBy(oldElements, newElements, 'uuid'),
removed: differenceBy(newElements, oldElements, 'uuid')
}
}