mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-09 20:29:23 +02:00
PUBLICIP_PERIOD environment variable
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package params
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
libparams "github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
// GetPublicIPPeriod obtains the period to fetch the IP address periodically.
|
||||
// Set to 0 to disable
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user