Commit dfd0d2685b01798dbf2170d060808ce55f301e78

Authored by Andrii Shvaika
1 parent 7b3d903c

Fix issue with locks

@@ -50,9 +50,9 @@ public class DefaultTbDeviceProfileCache implements TbDeviceProfileCache { @@ -50,9 +50,9 @@ public class DefaultTbDeviceProfileCache implements TbDeviceProfileCache {
50 public DeviceProfile get(TenantId tenantId, DeviceProfileId deviceProfileId) { 50 public DeviceProfile get(TenantId tenantId, DeviceProfileId deviceProfileId) {
51 DeviceProfile profile = deviceProfilesMap.get(deviceProfileId); 51 DeviceProfile profile = deviceProfilesMap.get(deviceProfileId);
52 if (profile == null) { 52 if (profile == null) {
53 - deviceProfileFetchLock.lock();  
54 profile = deviceProfilesMap.get(deviceProfileId); 53 profile = deviceProfilesMap.get(deviceProfileId);
55 if (profile == null) { 54 if (profile == null) {
  55 + deviceProfileFetchLock.lock();
56 try { 56 try {
57 profile = deviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); 57 profile = deviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
58 if (profile != null) { 58 if (profile != null) {