OSDN Git Service

change check_frequency
authorHAOYUatHZ <haoyu@protonmail.com>
Wed, 28 Aug 2019 06:46:26 +0000 (14:46 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Wed, 28 Aug 2019 06:46:26 +0000 (14:46 +0800)
docs/precog/config_example.json
toolbar/precog/config/config.go
toolbar/precog/monitor/connection.go

index c2757ce..ca47453 100644 (file)
@@ -13,7 +13,7 @@
         },
         "log_mode" : true
     },
-    "check_frequency_seconds" : 60,
+    "check_frequency_minutes" : 30,
     "seeds" : [
         {
             "alias" : "seed1",
index 7e42211..55a905a 100644 (file)
@@ -36,7 +36,7 @@ func NewConfigWithPath(path string) *Config {
 type Config struct {
        NetworkID        uint64             `json:"network_id"`
        MySQLConfig      common.MySQLConfig `json:"mysql"`
-       CheckFreqSeconds uint64             `json:"check_frequency_seconds"`
+       CheckFreqMinutes uint64             `json:"check_frequency_minutes"`
        Policy           Policy             `json:"policy"`
        Nodes            []Node             `json:"seeds"`
        API              API                `json:"api"`
index 0f378f8..0e27199 100644 (file)
@@ -10,7 +10,7 @@ import (
 )
 
 func (m *monitor) connectNodesRoutine() {
-       ticker := time.NewTicker(time.Duration(m.cfg.CheckFreqSeconds) * time.Second)
+       ticker := time.NewTicker(time.Duration(m.cfg.CheckFreqMinutes) * time.Minute)
        for ; true; <-ticker.C {
                <-m.dialCh
                m.Lock()