This repository was archived by the owner on Jul 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,6 @@ exports.ALPHA = 3
3838
3939// How often we look for our closest DHT neighbours
4040exports . QUERY_SELF_INTERVAL = Number ( 5 * minute )
41+
42+ // How often we try to find new peers
43+ exports . TABLE_REFRESH_INTERVAL = Number ( 5 * minute )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const PeerId = require('peer-id')
88const utils = require ( '../utils' )
99const length = require ( 'it-length' )
1010const { TimeoutController } = require ( 'timeout-abort-controller' )
11+ const { TABLE_REFRESH_INTERVAL } = require ( '../constants' )
1112
1213/**
1314 * @typedef {import('./types').KBucketPeer } KBucketPeer
@@ -30,13 +31,13 @@ class RoutingTableRefresh {
3031 * @param {import('../peer-routing').PeerRouting } params.peerRouting
3132 * @param {import('./').RoutingTable } params.routingTable
3233 * @param {boolean } params.lan
33- * @param {number } [params.refreshInterval=30000 ]
34+ * @param {number } [params.refreshInterval]
3435 */
3536 constructor ( { peerRouting, routingTable, refreshInterval, lan } ) {
3637 this . _log = utils . logger ( `libp2p:kad-dht:${ lan ? 'lan' : 'wan' } :routing-table:refresh` )
3738 this . _peerRouting = peerRouting
3839 this . _routingTable = routingTable
39- this . _refreshInterval = refreshInterval || 30000
40+ this . _refreshInterval = refreshInterval || TABLE_REFRESH_INTERVAL
4041
4142 /** @type {Date[] } */
4243 this . commonPrefixLengthRefreshedAt = [ ]
You can’t perform that action at this time.
0 commit comments