EDQS: added error handling while data sync
This commit is contained in:
parent
7e010385f1
commit
1f242df5eb
@ -161,6 +161,7 @@ public abstract class EdqsSyncService {
|
|||||||
|
|
||||||
private void processRelationBatch(List<RelationEntity> relations) {
|
private void processRelationBatch(List<RelationEntity> relations) {
|
||||||
for (RelationEntity relation : relations) {
|
for (RelationEntity relation : relations) {
|
||||||
|
try {
|
||||||
if (RelationTypeGroup.COMMON.name().equals(relation.getRelationTypeGroup())) {
|
if (RelationTypeGroup.COMMON.name().equals(relation.getRelationTypeGroup())) {
|
||||||
EntityIdInfo entityIdInfo = entityInfoMap.get(relation.getFromId());
|
EntityIdInfo entityIdInfo = entityInfoMap.get(relation.getFromId());
|
||||||
if (entityIdInfo != null) {
|
if (entityIdInfo != null) {
|
||||||
@ -169,6 +170,9 @@ public abstract class EdqsSyncService {
|
|||||||
log.info("Relation from id not found: {} ", relation);
|
log.info("Relation from id not found: {} ", relation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Failed to sync relation batch: {}", relation, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,6 +211,7 @@ public abstract class EdqsSyncService {
|
|||||||
|
|
||||||
private void processAttributeBatch(List<AttributeKvEntity> batch) {
|
private void processAttributeBatch(List<AttributeKvEntity> batch) {
|
||||||
for (AttributeKvEntity attribute : batch) {
|
for (AttributeKvEntity attribute : batch) {
|
||||||
|
try {
|
||||||
attribute.setStrKey(getStrKeyOrFetchFromDb(attribute.getId().getAttributeKey()));
|
attribute.setStrKey(getStrKeyOrFetchFromDb(attribute.getId().getAttributeKey()));
|
||||||
UUID entityId = attribute.getId().getEntityId();
|
UUID entityId = attribute.getId().getEntityId();
|
||||||
EntityIdInfo entityIdInfo = entityInfoMap.get(entityId);
|
EntityIdInfo entityIdInfo = entityInfoMap.get(entityId);
|
||||||
@ -220,6 +225,9 @@ public abstract class EdqsSyncService {
|
|||||||
attribute.toData(),
|
attribute.toData(),
|
||||||
attribute.getVersion());
|
attribute.getVersion());
|
||||||
process(entityIdInfo.tenantId(), ATTRIBUTE_KV, attributeKv);
|
process(entityIdInfo.tenantId(), ATTRIBUTE_KV, attributeKv);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Failed to sync attribute batch: {}", attribute, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user