Browse Source

优化修改代码, 解决程序启动无网络时, 长时间离线无法重新断电上电激活4G模组的问题

niujiuru 3 weeks atrás
parent
commit
9ccea4bde4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      netmgrd/netmgrd.go

+ 2 - 1
netmgrd/netmgrd.go

@@ -172,7 +172,8 @@ func offlineDuration() time.Duration {
 	}
 	ts := offlineStartTs.Load()
 	if ts == 0 {
-		return 0
+		offlineStartTs.Store(time.Now().UnixNano())
+		ts = offlineStartTs.Load()
 	}
 	return time.Since(time.Unix(0, ts))
 }