From dc03d5d83df1e9e596edc599c70edb44a6dc8d68 Mon Sep 17 00:00:00 2001 From: lejianwen <84855512@qq.com> Date: Sat, 15 Mar 2025 21:02:08 +0800 Subject: [PATCH] style: Update peer last online time logic (#173) --- http/controller/api/index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/controller/api/index.go b/http/controller/api/index.go index 248ccfe..c5a4be7 100644 --- a/http/controller/api/index.go +++ b/http/controller/api/index.go @@ -56,7 +56,7 @@ func (i *Index) Heartbeat(c *gin.Context) { return } //如果在40s以内则不更新 - if time.Now().Unix()-peer.LastOnlineTime > 40 { + if time.Now().Unix()-peer.LastOnlineTime >= 30 { upp := &model.Peer{RowId: peer.RowId, LastOnlineTime: time.Now().Unix(), LastOnlineIp: c.ClientIP()} service.AllService.PeerService.Update(upp) }