fixed AssetProfileServiceImpl

This commit is contained in:
dashevchenko 2023-11-10 15:40:56 +02:00
parent 6551658bfc
commit e6473c9c17

View File

@ -110,8 +110,8 @@ public class AssetProfileServiceImpl extends AbstractCachedEntityService<AssetPr
public AssetProfile findAssetProfileByName(TenantId tenantId, String profileName, boolean putInCache) { public AssetProfile findAssetProfileByName(TenantId tenantId, String profileName, boolean putInCache) {
log.trace("Executing findAssetProfileByName [{}][{}]", tenantId, profileName); log.trace("Executing findAssetProfileByName [{}][{}]", tenantId, profileName);
Validator.validateString(profileName, INCORRECT_ASSET_PROFILE_NAME + profileName); Validator.validateString(profileName, INCORRECT_ASSET_PROFILE_NAME + profileName);
return cache.getAndPutInTransaction(AssetProfileCacheKey.fromName(tenantId, profileName), return cache.getOrFetchFromDB(AssetProfileCacheKey.fromName(tenantId, profileName),
() -> assetProfileDao.findByName(tenantId, profileName), false); () -> assetProfileDao.findByName(tenantId, profileName), false, putInCache);
} }
@Override @Override