Browse Source
Merge pull request #14455 from AndriiLandiak/fix-user-cache
Fix user cache
pull/14476/head
Viacheslav Klimov
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
10 deletions
-
application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java
-
application/src/main/java/org/thingsboard/server/service/user/cache/DefaultUserAuthDetailsCache.java
|
|
|
@ -627,14 +627,11 @@ public class DefaultTbClusterService implements TbClusterService { |
|
|
|
// No need to push notifications twice
|
|
|
|
tbRuleEngineServices.removeAll(tbCoreServices); |
|
|
|
} |
|
|
|
boolean toRuleEngine = entityType != EntityType.USER; |
|
|
|
if (toRuleEngine) { |
|
|
|
for (String serviceId : tbRuleEngineServices) { |
|
|
|
TopicPartitionInfo tpi = topicService.getNotificationsTopic(ServiceType.TB_RULE_ENGINE, serviceId); |
|
|
|
ToRuleEngineNotificationMsg toRuleEngineMsg = ToRuleEngineNotificationMsg.newBuilder().setComponentLifecycle(componentLifecycleMsgProto).build(); |
|
|
|
toRuleEngineProducer.send(tpi, new TbProtoQueueMsg<>(msg.getEntityId().getId(), toRuleEngineMsg), null); |
|
|
|
toRuleEngineNfs.incrementAndGet(); |
|
|
|
} |
|
|
|
for (String serviceId : tbRuleEngineServices) { |
|
|
|
TopicPartitionInfo tpi = topicService.getNotificationsTopic(ServiceType.TB_RULE_ENGINE, serviceId); |
|
|
|
ToRuleEngineNotificationMsg toRuleEngineMsg = ToRuleEngineNotificationMsg.newBuilder().setComponentLifecycle(componentLifecycleMsgProto).build(); |
|
|
|
toRuleEngineProducer.send(tpi, new TbProtoQueueMsg<>(msg.getEntityId().getId(), toRuleEngineMsg), null); |
|
|
|
toRuleEngineNfs.incrementAndGet(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -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.msg.plugin.ComponentLifecycleMsg; |
|
|
|
import org.thingsboard.server.dao.user.UserService; |
|
|
|
import org.thingsboard.server.queue.util.TbCoreComponent; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@TbCoreComponent |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class DefaultUserAuthDetailsCache implements UserAuthDetailsCache { |
|
|
|
|
|
|
|
|