Skip to content

Commit

Permalink
fix strconv api
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancandevloper committed Oct 8, 2023
1 parent 56ccff0 commit b7e4ee8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/utils/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ func GetClusterClientConfig() config.Config {
qpsFloat32 = float32(qpsFloat)
}
burst := os.Getenv("CLUSTER_CLIENT_BURST")
burstInt, err := strconv.ParseInt(burst, 10, 64)
burstInt, err := strconv.Atoi(burst)
if err != nil {
burstInt = 10
}
timeout := os.Getenv("CLUSTER_CLIENT_TIMEOUT_SECONDS")
timeoutInt, err := strconv.ParseInt(timeout, 10, 64)
timeoutInt, err := strconv.Atoi(timeout)
if err != nil {
timeoutInt = 0
}
Expand All @@ -210,15 +210,15 @@ func GetClusterClientConfig() config.Config {
clusterCacheSyncEnableBool = false
}
clusterCacheSyncInterval := os.Getenv("DISCOVERY_CACHE_SYNC_PERIOD")
clusterCacheSyncIntervalInt, err := strconv.ParseInt(clusterCacheSyncInterval, 10, 64)
clusterCacheSyncIntervalInt, err := strconv.Atoi(clusterCacheSyncInterval)
if err != nil {
clusterCacheSyncIntervalInt = 60
}
return config.Config{
QPS: qpsFloat32,
Burst: int(burstInt),
TimeoutSecond: int(timeoutInt),
Burst: burstInt,
TimeoutSecond: timeoutInt,
ClusterCacheSyncEnable: clusterCacheSyncEnableBool,
ClusterCacheSyncInterval: int(clusterCacheSyncIntervalInt),
ClusterCacheSyncInterval: clusterCacheSyncIntervalInt,
}
}

0 comments on commit b7e4ee8

Please sign in to comment.