Skip to content

Commit

Permalink
refactor: 优化子设备注销消息逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Apr 19, 2024
1 parent a83ba95 commit 9157c88
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@
* @since 1.5
*/
@AllArgsConstructor
@Getter
public class DeviceGatewayHelper {

@Getter
private final DeviceRegistry registry;
@Getter
private final DeviceSessionManager sessionManager;
@Getter
private final DecodedClientMessageHandler messageHandler;

public static Consumer<DeviceSession> applySessionKeepaliveTimeout(DeviceMessage msg, Supplier<Duration> timeoutSupplier) {
Expand Down Expand Up @@ -112,7 +110,7 @@ private Mono<Void> handleChildrenDeviceMessage(String deviceId, DeviceMessage ch
return sessionManager
.remove(childrenId, removeSessionOnlyLocal(children))
.doOnNext(total -> {
if (total > 0) {
if (total > 0 && children instanceof DeviceOfflineMessage) {
children.addHeader(Headers.ignore, true);
}
})
Expand Down

0 comments on commit 9157c88

Please sign in to comment.