Browse Source
Merge pull request #13021 from YevhenBondarenko/feature/default-debug-duration
added default debugDuration to the profileData
pull/13040/head
Viacheslav Klimov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
19 additions and
3 deletions
-
application/src/main/data/upgrade/basic/schema_update.sql
-
application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java
-
common/util/src/main/java/org/thingsboard/common/util/DebugModeUtil.java
-
dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileServiceImpl.java
|
|
|
@ -83,3 +83,13 @@ SET profile_data = profile_data |
|
|
|
WHERE profile_data->'configuration'->>'maxCalculatedFieldsPerEntity' IS NULL; |
|
|
|
|
|
|
|
-- UPDATE TENANT PROFILE CALCULATED FIELD LIMITS END |
|
|
|
|
|
|
|
-- UPDATE TENANT PROFILE DEBUG DURATION START |
|
|
|
|
|
|
|
UPDATE tenant_profile |
|
|
|
SET profile_data = jsonb_set(profile_data, '{configuration,maxDebugModeDurationMinutes}', '15', true) |
|
|
|
WHERE |
|
|
|
profile_data->'configuration' ? 'maxDebugModeDurationMinutes' = false |
|
|
|
OR (profile_data->'configuration'->>'maxDebugModeDurationMinutes')::int = 0; |
|
|
|
|
|
|
|
-- UPDATE TENANT PROFILE DEBUG DURATION END |
|
|
|
|
|
|
|
@ -122,6 +122,7 @@ import java.util.concurrent.Executors; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
|
|
|
import static org.thingsboard.common.util.DebugModeUtil.DEBUG_MODE_DEFAULT_DURATION_MINUTES; |
|
|
|
import static org.thingsboard.server.common.data.DataConstants.DEFAULT_DEVICE_TYPE; |
|
|
|
import static org.thingsboard.server.service.security.auth.jwt.settings.DefaultJwtSettingsService.isSigningKeyDefault; |
|
|
|
import static org.thingsboard.server.service.security.auth.jwt.settings.DefaultJwtSettingsService.validateKeyLength; |
|
|
|
@ -199,7 +200,9 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { |
|
|
|
tenantProfileService.findOrCreateDefaultTenantProfile(TenantId.SYS_TENANT_ID); |
|
|
|
|
|
|
|
TenantProfileData isolatedRuleEngineTenantProfileData = new TenantProfileData(); |
|
|
|
isolatedRuleEngineTenantProfileData.setConfiguration(new DefaultTenantProfileConfiguration()); |
|
|
|
DefaultTenantProfileConfiguration configuration = new DefaultTenantProfileConfiguration(); |
|
|
|
configuration.setMaxDebugModeDurationMinutes(DEBUG_MODE_DEFAULT_DURATION_MINUTES); |
|
|
|
isolatedRuleEngineTenantProfileData.setConfiguration(configuration); |
|
|
|
|
|
|
|
TenantProfileQueueConfiguration mainQueueConfiguration = new TenantProfileQueueConfiguration(); |
|
|
|
mainQueueConfiguration.setName(DataConstants.MAIN_QUEUE_NAME); |
|
|
|
|
|
|
|
@ -22,7 +22,7 @@ import java.util.Set; |
|
|
|
|
|
|
|
public final class DebugModeUtil { |
|
|
|
|
|
|
|
private static final int DEBUG_MODE_DEFAULT_DURATION_MINUTES = 15; |
|
|
|
public static final int DEBUG_MODE_DEFAULT_DURATION_MINUTES = 15; |
|
|
|
|
|
|
|
private DebugModeUtil() { |
|
|
|
} |
|
|
|
|
|
|
|
@ -44,6 +44,7 @@ import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
import static org.thingsboard.common.util.DebugModeUtil.DEBUG_MODE_DEFAULT_DURATION_MINUTES; |
|
|
|
import static org.thingsboard.server.dao.service.Validator.validateId; |
|
|
|
|
|
|
|
@Service("TenantProfileDaoService") |
|
|
|
@ -160,7 +161,9 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant |
|
|
|
defaultTenantProfile.setDefault(true); |
|
|
|
defaultTenantProfile.setName("Default"); |
|
|
|
TenantProfileData profileData = new TenantProfileData(); |
|
|
|
profileData.setConfiguration(new DefaultTenantProfileConfiguration()); |
|
|
|
DefaultTenantProfileConfiguration configuration = new DefaultTenantProfileConfiguration(); |
|
|
|
configuration.setMaxDebugModeDurationMinutes(DEBUG_MODE_DEFAULT_DURATION_MINUTES); |
|
|
|
profileData.setConfiguration(configuration); |
|
|
|
defaultTenantProfile.setProfileData(profileData); |
|
|
|
defaultTenantProfile.setDescription("Default tenant profile"); |
|
|
|
defaultTenantProfile.setIsolatedTbRuleEngine(false); |
|
|
|
|