fixed events ordering during tenant creation
This commit is contained in:
parent
85f2047c8b
commit
898d69a4ad
@ -136,18 +136,20 @@ public class TenantServiceImpl extends AbstractCachedEntityService<TenantId, Ten
|
|||||||
TenantId tenantId = savedTenant.getId();
|
TenantId tenantId = savedTenant.getId();
|
||||||
publishEvictEvent(new TenantEvictEvent(tenantId, create));
|
publishEvictEvent(new TenantEvictEvent(tenantId, create));
|
||||||
|
|
||||||
|
if (create && defaultEntitiesCreator != null) {
|
||||||
|
defaultEntitiesCreator.accept(tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId)
|
||||||
|
.entityId(tenantId).entity(savedTenant).created(create).build());
|
||||||
|
|
||||||
if (create) {
|
if (create) {
|
||||||
deviceProfileService.createDefaultDeviceProfile(tenantId);
|
deviceProfileService.createDefaultDeviceProfile(tenantId);
|
||||||
assetProfileService.createDefaultAssetProfile(tenantId);
|
assetProfileService.createDefaultAssetProfile(tenantId);
|
||||||
apiUsageStateService.createDefaultApiUsageState(tenantId, null);
|
apiUsageStateService.createDefaultApiUsageState(tenantId, null);
|
||||||
notificationSettingsService.createDefaultNotificationConfigs(tenantId);
|
notificationSettingsService.createDefaultNotificationConfigs(tenantId);
|
||||||
if (defaultEntitiesCreator != null) {
|
|
||||||
defaultEntitiesCreator.accept(tenantId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
eventPublisher.publishEvent(SaveEntityEvent.builder().tenantId(tenantId)
|
|
||||||
.entityId(tenantId).entity(savedTenant).created(create).build());
|
|
||||||
return savedTenant;
|
return savedTenant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user