OSDN Git Service

try_err....
authorHAOYUatHZ <haoyu@protonmail.com>
Tue, 20 Aug 2019 07:10:20 +0000 (15:10 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Tue, 20 Aug 2019 07:10:20 +0000 (15:10 +0800)
toolbar/precog/monitor/connection.go
toolbar/precog/monitor/monitor.go

index eef0cd6..a440d77 100644 (file)
@@ -11,7 +11,7 @@ import (
 
 func (m *monitor) connectNodesRoutine() {
        // TODO: change name?
-       ticker := time.NewTicker(time.Duration(m.cfg.CheckFreqSeconds*2) * time.Second)
+       ticker := time.NewTicker(time.Duration(m.cfg.CheckFreqSeconds+15) * time.Second)
        for ; true; <-ticker.C {
                if err := m.dialNodes(); err != nil {
                        log.Error(err)
index 2d84587..81b0c1f 100644 (file)
@@ -44,7 +44,7 @@ type monitor struct {
 // TODO: set myself as SPV?
 func NewMonitor(cfg *config.Config, db *gorm.DB) *monitor {
        //TODO: for test
-       cfg.CheckFreqSeconds = 120
+       cfg.CheckFreqSeconds = 15
 
        dbPath, err := makePath()
        if err != nil {