|
|
|
@ -486,7 +486,7 @@ public class DefaultDeviceStateService extends AbstractPartitionBasedService<Dev |
|
|
|
if (stateData != null) { |
|
|
|
DeviceState state = stateData.getState(); |
|
|
|
if (!isActive(ts, state) |
|
|
|
&& (state.getLastInactivityAlarmTime() == 0L || state.getLastInactivityAlarmTime() < state.getLastActivityTime()) |
|
|
|
&& (state.getLastInactivityAlarmTime() == 0L || state.getLastInactivityAlarmTime() <= state.getLastActivityTime()) |
|
|
|
&& stateData.getDeviceCreationTime() + state.getInactivityTimeout() < ts) { |
|
|
|
if (partitionService.resolve(ServiceType.TB_CORE, stateData.getTenantId(), deviceId).isMyPartition()) { |
|
|
|
state.setActive(false); |
|
|
|
|