mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-10 04:30:20 +02:00
chore(env): getEnvWithRetro helper function
This commit is contained in:
+2
-8
@@ -30,15 +30,9 @@ func (r *Reader) ReadHealth() (health settings.Health, err error) {
|
||||
}
|
||||
|
||||
func (r *Reader) readDurationWithRetro(envKey, retroEnvKey string) (d *time.Duration, err error) {
|
||||
s := os.Getenv(retroEnvKey)
|
||||
envKey, s := r.getEnvWithRetro(envKey, retroEnvKey)
|
||||
if s == "" {
|
||||
s = os.Getenv(envKey)
|
||||
if s == "" {
|
||||
return nil, nil //nolint:nilnil
|
||||
}
|
||||
} else {
|
||||
r.onRetroActive(envKey, retroEnvKey)
|
||||
envKey = retroEnvKey
|
||||
return nil, nil //nolint:nilnil
|
||||
}
|
||||
|
||||
d = new(time.Duration)
|
||||
|
||||
Reference in New Issue
Block a user