Browse Source

rule-engine: document the rule chain init checks in the API usage state handler

pull/16343/head
Sergey Matvienko 2 months ago
parent
commit
2aeceb6440
  1. 2
      application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java

2
application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java

@ -319,6 +319,8 @@ public class TenantActor extends RuleChainManagerActor {
if (entityType.equals(EntityType.API_USAGE_STATE)) { if (entityType.equals(EntityType.API_USAGE_STATE)) {
ApiUsageState old = getApiUsageState(); ApiUsageState old = getApiUsageState();
apiUsageState = new ApiUsageState(systemContext.getApiUsageStateService().getApiUsageState(tenantId)); apiUsageState = new ApiUsageState(systemContext.getApiUsageStateService().getApiUsageState(tenantId));
// Rule chains are initialized only on the rule engine service that manages the tenant, with the same checks
// (isRuleEngine, isManagedByCurrentService, isReExecEnabled) as in init() and onPartitionChangeMsg()
if (isRuleEngine) { if (isRuleEngine) {
if (old.isReExecEnabled() && !apiUsageState.isReExecEnabled()) { if (old.isReExecEnabled() && !apiUsageState.isReExecEnabled()) {
log.info("[{}] Received API state update. Going to DISABLE Rule Engine execution.", tenantId); log.info("[{}] Received API state update. Going to DISABLE Rule Engine execution.", tenantId);

Loading…
Cancel
Save