Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set ROTATE_INTERVAL #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function DHT (opts) {

var self = this

this._tables = LRU({maxAge: ROTATE_INTERVAL, max: opts.maxTables || 1000})
this._tables = LRU({maxAge: opts.rotateInterval || ROTATE_INTERVAL, max: opts.maxTables || 1000})
this._values = LRU(opts.maxValues || 1000)
this._peers = records({
maxAge: opts.maxAge || 0,
Expand All @@ -44,7 +44,7 @@ function DHT (opts) {
this._rotateSecrets()
this._verify = opts.verify || null
this._host = opts.host || null
this._interval = setInterval(rotateSecrets, ROTATE_INTERVAL)
this._interval = setInterval(rotateSecrets, opts.rotateInterval || ROTATE_INTERVAL)
this._runningBucketCheck = false
this._bucketCheckTimeout = null
this._bucketOutdatedTimeSpan = opts.timeBucketOutdated || BUCKET_OUTDATED_TIMESPAN
Expand Down