Skip to content

Commit f85288b

Browse files
author
Vladyslav Papidokha
committed
Updated config consts list
1 parent 5c3ca9e commit f85288b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

internal/config/config.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ import (
1010
)
1111

1212
const (
13+
DefaultDebugMode = false
1314
DefaultServerPort = "8080"
1415
DefaultServerReadTimeout = 10 * time.Second
1516
DefaultServerWriteTimeout = 10 * time.Second
1617
DefaultServerIdleTimeout = 120 * time.Second
1718
DefaultServerShutdownTimeout = 10 * time.Second
19+
DefaultServerPPROFEnabled = false
1820
DefaultStorageType = "etcd"
1921
DefaultEtcdAddrList = "http://localhost:2379"
2022
DefaultEtcdTLSEnabled = false
2123
DefaultEtcdServerCACertPath = "/etc/etcd/ca.crt"
2224
DefaultEtcdServerClientCertPath = "/etc/etcd/client.crt"
2325
DefaultEtcdServerClientKeyPath = "/etc/etcd/client.key"
24-
DefaultCacheSize = 1000
2526
DefaultCacheEnabled = false
27+
DefaultCacheSize = 1000
2628
)
2729

2830
type Config struct {
@@ -76,7 +78,7 @@ func NewConfig() *Config {
7678
return &Config{
7779
Server: ServerCfg{
7880
Port: getEnv("SHARED_LOCK_SERVER_PORT", DefaultServerPort),
79-
PPROFEnabled: getEnv("SHARED_LOCK_PPROF_ENABLED", true),
81+
PPROFEnabled: getEnv("SHARED_LOCK_PPROF_ENABLED", bool(DefaultServerPPROFEnabled)),
8082
Timeout: ServerTimeout{
8183
Read: getEnv("SHARED_LOCK_SERVER_READ_TIMEOUT", DefaultServerReadTimeout),
8284
Write: getEnv("SHARED_LOCK_SERVER_WRITE_TIMEOUT", DefaultServerWriteTimeout),
@@ -95,10 +97,10 @@ func NewConfig() *Config {
9597
},
9698
},
9799
Cache: CacheCfg{
98-
Enabled: getEnv("SHARED_LOCK_CACHE_ENABLED", true),
100+
Enabled: getEnv("SHARED_LOCK_CACHE_ENABLED", DefaultCacheEnabled),
99101
Size: getEnv("SHARED_LOCK_CACHE_SIZE", DefaultCacheSize),
100102
},
101-
Debug: getEnv("SHARED_LOCK_DEBUG", false),
103+
Debug: getEnv("SHARED_LOCK_DEBUG", bool(DefaultDebugMode)),
102104
}
103105
}
104106

0 commit comments

Comments
 (0)