Browse Source

Revert "Init all actors for isolated rule engines"

This reverts commit bf0cc22223.
pull/10028/head
ViacheslavKlimov 2 years ago
parent
commit
e502c5ebba
  1. 3
      application/src/main/java/org/thingsboard/server/actors/app/AppActor.java
  2. 20
      application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java

3
application/src/main/java/org/thingsboard/server/actors/app/AppActor.java

@ -202,7 +202,8 @@ public class AppActor extends ContextAwareActor {
return Optional.ofNullable(ctx.getOrCreateChildActor(new TbEntityActorId(tenantId),
() -> DefaultActorService.TENANT_DISPATCHER_NAME,
() -> new TenantActor.ActorCreator(systemContext, tenantId),
() -> true));
() -> systemContext.getServiceInfoProvider().isService(ServiceType.TB_CORE) ||
systemContext.getPartitionService().isManagedByCurrentService(tenantId)));
}
private void onToEdgeSessionMsg(EdgeSessionMsg msg) {

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

@ -90,16 +90,18 @@ public class TenantActor extends RuleChainManagerActor {
isCore = systemContext.getServiceInfoProvider().isService(ServiceType.TB_CORE);
isRuleEngine = systemContext.getServiceInfoProvider().isService(ServiceType.TB_RULE_ENGINE);
if (isRuleEngine) {
try {
if (getApiUsageState().isReExecEnabled()) {
log.debug("[{}] Going to init rule chains", tenantId);
initRuleChains();
} else {
log.info("[{}] Skip init of the rule chains due to API limits", tenantId);
if (systemContext.getPartitionService().isManagedByCurrentService(tenantId)) {
try {
if (getApiUsageState().isReExecEnabled()) {
log.debug("[{}] Going to init rule chains", tenantId);
initRuleChains();
} else {
log.info("[{}] Skip init of the rule chains due to API limits", tenantId);
}
} catch (Exception e) {
log.info("Failed to check ApiUsage \"ReExecEnabled\"!!!", e);
cantFindTenant = true;
}
} catch (Exception e) {
log.info("Failed to check ApiUsage \"ReExecEnabled\"!!!", e);
cantFindTenant = true;
}
}
log.debug("[{}] Tenant actor started.", tenantId);

Loading…
Cancel
Save