Skip to content

Commit 61886ef

Browse files
committed
setting ttl
1 parent 4132380 commit 61886ef

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

core/clustersmngr/factory.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
"os"
87
"sync"
98
"time"
109

@@ -34,25 +33,9 @@ const (
3433
)
3534

3635
var (
37-
usersClientsTTL = getEnvDuration("WEAVE_GITOPS_USERS_CLIENTS_TTL", 24*time.Hour)
36+
usersClientsTTL = 24 * time.Hour
3837
)
3938

40-
func getEnvDuration(key string, defaultDuration time.Duration) time.Duration {
41-
val := os.Getenv(key)
42-
if val == "" {
43-
return defaultDuration
44-
}
45-
46-
d, err := time.ParseDuration(val)
47-
48-
// on error return the default duration
49-
if err != nil {
50-
return defaultDuration
51-
}
52-
53-
return d
54-
}
55-
5639
var (
5740
opsUpdateClusters = prometheus.NewCounter(
5841
prometheus.CounterOpts{

0 commit comments

Comments
 (0)