Skip to content

Commit

Permalink
1 min limit for peerUpdate trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
yabinma committed Nov 18, 2024
1 parent 74306d6 commit 9ec8283
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mq/publishers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9ec8283

Please sign in to comment.