mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-16 10:06:28 +08:00
1 min limit for peerUpdate trigger
This commit is contained in:
parent
74306d6ed1
commit
9ec8283659
1 changed files with 5 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue