From dfd0d2685b01798dbf2170d060808ce55f301e78 Mon Sep 17 00:00:00 2001 From: Andrii Shvaika Date: Wed, 7 Oct 2020 15:17:06 +0300 Subject: [PATCH] Fix issue with locks --- .../server/service/profile/DefaultTbDeviceProfileCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/thingsboard/server/service/profile/DefaultTbDeviceProfileCache.java b/application/src/main/java/org/thingsboard/server/service/profile/DefaultTbDeviceProfileCache.java index 085bb26e8c..b0b47fe886 100644 --- a/application/src/main/java/org/thingsboard/server/service/profile/DefaultTbDeviceProfileCache.java +++ b/application/src/main/java/org/thingsboard/server/service/profile/DefaultTbDeviceProfileCache.java @@ -50,9 +50,9 @@ public class DefaultTbDeviceProfileCache implements TbDeviceProfileCache { public DeviceProfile get(TenantId tenantId, DeviceProfileId deviceProfileId) { DeviceProfile profile = deviceProfilesMap.get(deviceProfileId); if (profile == null) { - deviceProfileFetchLock.lock(); profile = deviceProfilesMap.get(deviceProfileId); if (profile == null) { + deviceProfileFetchLock.lock(); try { profile = deviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); if (profile != null) {