From 85a0f0a26c86a8e33e6390b92a2abf77591e0d95 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Tue, 5 Jul 2022 11:12:28 +0200 Subject: [PATCH] changed interval to seconds --- config.yaml | 4 ++-- main.go | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/config.yaml b/config.yaml index 12ee688..81f9323 100644 --- a/config.yaml +++ b/config.yaml @@ -1,8 +1,8 @@ bandwidth: min: 2 max: 45 - step: 2 -interval: 5 + step: 1 +interval: 30 host: "itsh.dev" ppp: 5 conformation_ppp: 30 diff --git a/main.go b/main.go index dc2d784..ee75487 100644 --- a/main.go +++ b/main.go @@ -23,15 +23,15 @@ type Conf struct { Min int `yaml:"min"` Step int `yaml:"step"` } `yaml:"bandwidth"` - Interval float64 `yaml:"interval"` - Host string `yaml:"host"` - PPP int `yaml:"ppp"` - ConformationPPP int `yaml:"conformation_ppp"` - LogLevel string `yaml:"log_level"` - UploadInterface string `yaml:"upload_interface"` - CakeOptions string `yaml:"cake_options"` - ThrottlePingThreshold int64 `yaml:"throttle_ping_threshold"` - TryRestoringAfter int `yaml:"try_restoring_after"` + Interval int `yaml:"interval"` + Host string `yaml:"host"` + PPP int `yaml:"ppp"` + ConformationPPP int `yaml:"conformation_ppp"` + LogLevel string `yaml:"log_level"` + UploadInterface string `yaml:"upload_interface"` + CakeOptions string `yaml:"cake_options"` + ThrottlePingThreshold int64 `yaml:"throttle_ping_threshold"` + TryRestoringAfter int `yaml:"try_restoring_after"` } var ( @@ -171,7 +171,8 @@ func (m UploadManager) pingWorker() error { } } } - time.Sleep(time.Duration(conf.Interval) * time.Minute) + log.Debugf("sleep for %s", time.Duration(conf.Interval)*time.Second) + time.Sleep(time.Duration(conf.Interval) * time.Second) } }