fix(xo-server): limit number of xapiObjectToXo logs

See xoa-support#3830
This commit is contained in:
Julien Fontanet
2021-06-16 09:59:07 +02:00
parent 51f013851d
commit 033b671d0b

View File

@@ -224,7 +224,13 @@ export default class {
objects.set(xoId, xoObject)
}
} catch (error) {
log.error('xapiObjectToXo', { error })
// only log the error if the object was already in `toRetry`
//
// otherwise there will be too many logs, some of them irrelevant (transient
// and simply due to the order objects are processed)
if (xapiId in toRetry) {
log.error('xapiObjectToXo', { error })
}
toRetry[xapiId] = xapiObject
}