Updater loop with period and http route (#240)
* Updater loop with period and http route * Using DNS over TLS to update servers * Better logging * Remove goroutines for cyberghost updater * Respects context for servers update (quite slow overall) * Increase shutdown grace period to 5 seconds * Update announcement * Add log lines for each provider update start
This commit is contained in:
17
internal/params/updater.go
Normal file
17
internal/params/updater.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package params
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
libparams "github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// GetUpdaterPeriod obtains the period to fetch the servers information when the tunnel is up.
|
||||
// Set to 0 to disable
|
||||
func (r *reader) GetUpdaterPeriod() (period time.Duration, err error) {
|
||||
s, err := r.envParams.GetEnv("UPDATER_PERIOD", libparams.Default("0"))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return time.ParseDuration(s)
|
||||
}
|
||||
Reference in New Issue
Block a user