1 min limit for peerUpdate trigger

This commit is contained in:
Max Ma 2024-11-18 14:16:18 +01:00
parent 74306d6ed1
commit 9ec8283659

View file

@ -19,16 +19,16 @@ import (
var batchSize = servercfg.GetPeerUpdateBatchSize()
var batchUpdate = servercfg.GetBatchPeerUpdate()
//var peerUpdateTS = time.Now().Unix()
var peerUpdateTS = time.Now().Unix()
// PublishPeerUpdate --- determines and publishes a peer update to all the hosts
func PublishPeerUpdate(replacePeers bool) error {
slog.Error("entering PublishPeerUpdate", "Debug")
t1 := time.Now().Unix()
//if time.Now().Unix()-peerUpdateTS < 60 {
// return nil
//}
//peerUpdateTS = time.Now().Unix()
if time.Now().Unix()-peerUpdateTS < 60 {
return nil
}
peerUpdateTS = time.Now().Unix()
pc, file, no, ok := runtime.Caller(1)
if ok {