Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abnormal update of ninactive when the device is offline #150

Open
ziguayungui opened this issue Feb 1, 2024 · 0 comments
Open

Abnormal update of ninactive when the device is offline #150

ziguayungui opened this issue Feb 1, 2024 · 0 comments

Comments

@ziguayungui
Copy link

Environment

rtty

  • arch:
  • os:
  • version:

rttys

  • arch:x86_64
  • os:Ubuntu
  • version: 18.04.6 LTS

Description

in device.go , 在设备离线情况下,ninactive 值更新存在问题。
now 和 dev.active 的差值会连续3次判断成立 -》 ninactive + 1

		case <-ticker.C:
			now := time.Now()
			if now.Sub(dev.active) > heartbeatInterval*3/2 {
				if dev.id == "" {
					return
				}

				log.Error().Msgf("Inactive device in long time: %s", dev.id)
				if ninactive > 1 {
					log.Error().Msgf("Inactive 3 times, now kill it: %s", dev.id)
					return
				}
				ninactive = ninactive + 1
			}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant