Showing
1 changed file
with
1 additions
and
1 deletions
@@ -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) { |