Files
gluetun/internal/params/publicip.go

18 lines
399 B
Go
Raw Normal View History

2020-07-16 01:12:54 +00:00
package params
import (
"time"
libparams "github.com/qdm12/golibs/params"
)
// GetPublicIPPeriod obtains the period to fetch the IP address periodically.
2020-10-20 02:45:28 +00:00
// Set to 0 to disable.
2020-07-16 01:12:54 +00:00
func (r *reader) GetPublicIPPeriod() (period time.Duration, err error) {
s, err := r.envParams.GetEnv("PUBLICIP_PERIOD", libparams.Default("12h"))
if err != nil {
return 0, err
}
return time.ParseDuration(s)
}