Skip to content

Commit 3f0945a

Browse files
committed
coreapi: move DefaultIpnsCacheSize to a const
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
1 parent 6044d2a commit 3f0945a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/core.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const IpnsValidatorTag = "ipns"
8282

8383
const kReprovideFrequency = time.Hour * 12
8484
const discoveryConnTimeout = time.Second * 30
85+
const DefaultIpnsCacheSize = 128
8586

8687
var log = logging.Logger("core")
8788

@@ -601,7 +602,7 @@ func (n *IpfsNode) getCacheSize() (int, error) {
601602

602603
cs := cfg.Ipns.ResolveCacheSize
603604
if cs == 0 {
604-
cs = 128
605+
cs = DefaultIpnsCacheSize
605606
}
606607
if cs < 0 {
607608
return 0, fmt.Errorf("cannot specify negative resolve cache size")

core/coreapi/coreapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e
198198

199199
cs := cfg.Ipns.ResolveCacheSize
200200
if cs == 0 {
201-
cs = 128
201+
cs = core.DefaultIpnsCacheSize
202202
}
203203
if cs < 0 {
204204
return nil, fmt.Errorf("cannot specify negative resolve cache size")

0 commit comments

Comments
 (0)