Merge branch 'vc-fixes' of github.com:ViacheslavKlimov/thingsboard into develop/3.4

This commit is contained in:
Andrii Shvaika 2022-06-28 11:02:23 +03:00
commit 50e6ca548d

View File

@ -384,12 +384,12 @@ public class DefaultEntitiesVersionControlService implements EntitiesVersionCont
} catch (Exception e) { } catch (Exception e) {
throw new LoadEntityException(entityData, e); throw new LoadEntityException(entityData, e);
} }
registerResult(ctx, entityType, importResult);
if (!importResult.isUpdatedAllExternalIds()) { if (!importResult.isUpdatedAllExternalIds()) {
ctx.getToReimport().put(entityData.getEntity().getExternalId(), new ReimportTask(reimportBackup, ctx.getSettings())); ctx.getToReimport().put(entityData.getEntity().getExternalId(), new ReimportTask(reimportBackup, ctx.getSettings()));
continue; continue;
} }
registerResult(ctx, entityType, importResult);
ctx.getImportedEntities().computeIfAbsent(entityType, t -> new HashSet<>()) ctx.getImportedEntities().computeIfAbsent(entityType, t -> new HashSet<>())
.add(importResult.getSavedEntity().getId()); .add(importResult.getSavedEntity().getId());
} }
@ -408,7 +408,6 @@ public class DefaultEntitiesVersionControlService implements EntitiesVersionCont
ctx.setSettings(settings); ctx.setSettings(settings);
EntityImportResult<?> importResult = exportImportService.importEntity(ctx, entityData); EntityImportResult<?> importResult = exportImportService.importEntity(ctx, entityData);
registerResult(ctx, externalId.getEntityType(), importResult);
ctx.getImportedEntities().computeIfAbsent(externalId.getEntityType(), t -> new HashSet<>()) ctx.getImportedEntities().computeIfAbsent(externalId.getEntityType(), t -> new HashSet<>())
.add(importResult.getSavedEntity().getId()); .add(importResult.getSavedEntity().getId());
} catch (Exception e) { } catch (Exception e) {