Skip to content

Abnormal update of ninactive when the device is offline #150

Open
@ziguayungui

Description

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
			}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions