Browse Source

style: Update peer last online time logic (#173)

lejianwen 10 months ago
parent
commit
dc03d5d83d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      http/controller/api/index.go

+ 1 - 1
http/controller/api/index.go

@@ -56,7 +56,7 @@ func (i *Index) Heartbeat(c *gin.Context) {
56 56
 		return
57 57
 	}
58 58
 	//如果在40s以内则不更新
59
-	if time.Now().Unix()-peer.LastOnlineTime > 40 {
59
+	if time.Now().Unix()-peer.LastOnlineTime >= 30 {
60 60
 		upp := &model.Peer{RowId: peer.RowId, LastOnlineTime: time.Now().Unix(), LastOnlineIp: c.ClientIP()}
61 61
 		service.AllService.PeerService.Update(upp)
62 62
 	}