Skip to content

Commit 6444de1

Browse files
committed
chore: use default values
1 parent cb41191 commit 6444de1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/client/src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ipnsValidator } from 'ipns/validator'
99
import { parse as ndjson } from 'it-ndjson'
1010
import defer from 'p-defer'
1111
import PQueue from 'p-queue'
12-
import { CACHE_NAME } from './constants.js'
1312
import { BadResponseError, InvalidRequestError } from './errors.js'
1413
import { DelegatedRoutingV1HttpApiClientContentRouting, DelegatedRoutingV1HttpApiClientPeerRouting } from './routings.js'
1514
import type { DelegatedRoutingV1HttpApiClient, DelegatedRoutingV1HttpApiClientInit, GetProvidersOptions, GetPeersOptions, GetIPNSOptions, PeerRecord } from './index.js'
@@ -22,7 +21,8 @@ const log = logger('delegated-routing-v1-http-api-client')
2221
const defaultValues = {
2322
concurrentRequests: 4,
2423
timeout: 30e3,
25-
cacheTTL: 5 * 60 * 1000 // 5 minutes default as per https://specs.ipfs.tech/routing/http-routing-v1/#response-headers
24+
cacheTTL: 5 * 60 * 1000, // 5 minutes default as per https://specs.ipfs.tech/routing/http-routing-v1/#response-headers
25+
cacheName: 'delegated-routing-v1-cache'
2626
}
2727

2828
export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV1HttpApiClient {
@@ -57,7 +57,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
5757
this.contentRouting = new DelegatedRoutingV1HttpApiClientContentRouting(this)
5858
this.peerRouting = new DelegatedRoutingV1HttpApiClientPeerRouting(this)
5959

60-
this.cacheName = init.cacheName ?? CACHE_NAME
60+
this.cacheName = init.cacheName ?? defaultValues.cacheName
6161
this.cacheTTL = init.cacheTTL ?? defaultValues.cacheTTL
6262
}
6363

packages/client/src/constants.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)