coreapi: move DefaultIpnsCacheSize to a const
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Dec 20, 2018 at 17:02 UTC
3f0945a1bdf12bdafb33a18657893a1896522075
2 files changed
+3
-2
core/core.go
+2
-1
@@ -82,6 +82,7 @@ const IpnsValidatorTag = "ipns"
82
83
const kReprovideFrequency = time.Hour * 12
84
const discoveryConnTimeout = time.Second * 30
85
+const DefaultIpnsCacheSize = 128
86
87
var log = logging.Logger("core")
88
@@ -601,7 +602,7 @@ func (n *IpfsNode) getCacheSize() (int, error) {
602
603
cs := cfg.Ipns.ResolveCacheSize
604
if cs == 0 {
604
- cs = 128
605
+ cs = DefaultIpnsCacheSize
606
}
607
if cs < 0 {
608
return 0, fmt.Errorf("cannot specify negative resolve cache size")
core/coreapi/coreapi.go
+1
-1
@@ -198,7 +198,7 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e
198
199
cs := cfg.Ipns.ResolveCacheSize
200
if cs == 0 {
201
- cs = 128
201
+ cs = core.DefaultIpnsCacheSize
202
}
203
if cs < 0 {
204
return nil, fmt.Errorf("cannot specify negative resolve cache size")