mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-02-17 14:04:51 +08:00
style: Update peer last online time logic (#173)
This commit is contained in:
@@ -56,7 +56,7 @@ func (i *Index) Heartbeat(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
//如果在40s以内则不更新
|
//如果在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()}
|
upp := &model.Peer{RowId: peer.RowId, LastOnlineTime: time.Now().Unix(), LastOnlineIp: c.ClientIP()}
|
||||||
service.AllService.PeerService.Update(upp)
|
service.AllService.PeerService.Update(upp)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user