Просмотр исходного кода

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

lejianwen месяцев назад: 10
Родитель
Сommit
891469909c
1 измененных файлов с 1 добавлено и 1 удалено
  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
 	}