Browse Source

Merge pull request #14455 from AndriiLandiak/fix-user-cache

Fix user cache
pull/14476/head
Viacheslav Klimov 10 months ago
committed by GitHub
parent
commit
d9f18e2a46
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java
  2. 2
      application/src/main/java/org/thingsboard/server/service/user/cache/DefaultUserAuthDetailsCache.java

3
application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java

@ -627,8 +627,6 @@ public class DefaultTbClusterService implements TbClusterService {
// No need to push notifications twice // No need to push notifications twice
tbRuleEngineServices.removeAll(tbCoreServices); tbRuleEngineServices.removeAll(tbCoreServices);
} }
boolean toRuleEngine = entityType != EntityType.USER;
if (toRuleEngine) {
for (String serviceId : tbRuleEngineServices) { for (String serviceId : tbRuleEngineServices) {
TopicPartitionInfo tpi = topicService.getNotificationsTopic(ServiceType.TB_RULE_ENGINE, serviceId); TopicPartitionInfo tpi = topicService.getNotificationsTopic(ServiceType.TB_RULE_ENGINE, serviceId);
ToRuleEngineNotificationMsg toRuleEngineMsg = ToRuleEngineNotificationMsg.newBuilder().setComponentLifecycle(componentLifecycleMsgProto).build(); ToRuleEngineNotificationMsg toRuleEngineMsg = ToRuleEngineNotificationMsg.newBuilder().setComponentLifecycle(componentLifecycleMsgProto).build();
@ -636,7 +634,6 @@ public class DefaultTbClusterService implements TbClusterService {
toRuleEngineNfs.incrementAndGet(); toRuleEngineNfs.incrementAndGet();
} }
} }
}
@Scheduled(fixedDelayString = "${cluster.stats.print_interval_ms}") @Scheduled(fixedDelayString = "${cluster.stats.print_interval_ms}")
public void printStats() { public void printStats() {

2
application/src/main/java/org/thingsboard/server/service/user/cache/DefaultUserAuthDetailsCache.java

@ -29,13 +29,11 @@ import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.id.UserId; import org.thingsboard.server.common.data.id.UserId;
import org.thingsboard.server.common.msg.plugin.ComponentLifecycleMsg; import org.thingsboard.server.common.msg.plugin.ComponentLifecycleMsg;
import org.thingsboard.server.dao.user.UserService; import org.thingsboard.server.dao.user.UserService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Service @Service
@TbCoreComponent
@RequiredArgsConstructor @RequiredArgsConstructor
public class DefaultUserAuthDetailsCache implements UserAuthDetailsCache { public class DefaultUserAuthDetailsCache implements UserAuthDetailsCache {

Loading…
Cancel
Save