Browse Source

refactoring

pull/8556/head
dashevchenko 3 years ago
parent
commit
9ef6501225
  1. 4
      application/src/main/java/org/thingsboard/server/service/apiusage/TenantApiUsageState.java
  2. 2
      common/data/src/main/java/org/thingsboard/server/common/data/tenant/profile/DefaultTenantProfileConfiguration.java

4
application/src/main/java/org/thingsboard/server/service/apiusage/TenantApiUsageState.java

@ -68,10 +68,10 @@ public class TenantApiUsageState extends BaseApiUsageState {
for (ApiUsageRecordKey recordKey : ApiUsageRecordKey.getKeys(feature)) {
long value = get(recordKey);
boolean featureEnabled = getProfileFeatureEnabled(recordKey);
long threshold = getProfileThreshold(recordKey);
long warnThreshold = getProfileWarnThreshold(recordKey);
ApiUsageStateValue tmpValue;
if (featureEnabled) {
long threshold = getProfileThreshold(recordKey);
long warnThreshold = getProfileWarnThreshold(recordKey);
if (threshold == 0 || value == 0 || value < warnThreshold) {
tmpValue = ApiUsageStateValue.ENABLED;
} else if (value < threshold) {

2
common/data/src/main/java/org/thingsboard/server/common/data/tenant/profile/DefaultTenantProfileConfiguration.java

@ -110,7 +110,7 @@ public class DefaultTenantProfileConfiguration implements TenantProfileConfigura
public boolean getProfileFeatureEnabled(ApiUsageRecordKey key) {
switch (key) {
case SMS_EXEC_COUNT:
return smsEnabled == null || smsEnabled;
return smsEnabled == null || Boolean.TRUE.equals(smsEnabled);
default:
return true;
}

Loading…
Cancel
Save