Skip to content

Commit 874001a

Browse files
committed
UPDATE: Make Announce Interval configuration constant to default behaviour
1 parent 474f1ff commit 874001a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

server/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ const Swarm = require('./swarm')
2525
* @param {boolean} opts.stats enable web-based statistics? (default: true)
2626
* @param {function} opts.filter black/whitelist fn for disallowing/allowing torrents
2727
*/
28-
const TEN_MINUTES = 10 * 60 * 1000
28+
29+
// NOTE: Interval gets divided by 5 for websocket trackers,
30+
// so multiply the intended interval by 5const TEN_MINUTES = 10 * 60 * 1000
31+
// Original default was 10 minutes
32+
const MINUTE = 1000 * 60
33+
const defaultInterval = MINUTE * 15 * 5 // Client announce interval, in milliseconds.
2934

3035
class Server extends EventEmitter {
3136
constructor (opts = {}) {
@@ -50,7 +55,7 @@ class Server extends EventEmitter {
5055
peersCacheTtl
5156
} = opts
5257

53-
this.intervalMs = interval || TEN_MINUTES
58+
this.intervalMs = interval || defaultInterval
5459
this._trustProxy = Boolean(trustProxy)
5560
this._filter = filter
5661
this.peersCacheLength = peersCacheLength

0 commit comments

Comments
 (0)