From 9ec8283659da1b7e14e4b6667b6209863099da0a Mon Sep 17 00:00:00 2001 From: Max Ma Date: Mon, 18 Nov 2024 14:16:18 +0100 Subject: [PATCH] 1 min limit for peerUpdate trigger --- mq/publishers.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mq/publishers.go b/mq/publishers.go index 91241e43a..357ca75c9 100644 --- a/mq/publishers.go +++ b/mq/publishers.go @@ -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 {