mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 03:16:24 +00:00
calling tracker.setInterval() should override current interval
This commit is contained in:
parent
582ac990a4
commit
208ae5d911
@ -8,16 +8,15 @@ inherits(Tracker, EventEmitter)
|
|||||||
function Tracker (client, announceUrl) {
|
function Tracker (client, announceUrl) {
|
||||||
var self = this
|
var self = this
|
||||||
EventEmitter.call(self)
|
EventEmitter.call(self)
|
||||||
|
|
||||||
self.client = client
|
self.client = client
|
||||||
self.announceUrl = announceUrl
|
self.announceUrl = announceUrl
|
||||||
|
|
||||||
self.interval = null
|
self.interval = null
|
||||||
self.destroyed = false
|
self.destroyed = false
|
||||||
}
|
}
|
||||||
|
|
||||||
Tracker.prototype.setInterval = function (intervalMs) {
|
Tracker.prototype.setInterval = function (intervalMs) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.interval) return
|
|
||||||
if (intervalMs == null) intervalMs = self.DEFAULT_ANNOUNCE_INTERVAL
|
if (intervalMs == null) intervalMs = self.DEFAULT_ANNOUNCE_INTERVAL
|
||||||
|
|
||||||
clearInterval(self.interval)
|
clearInterval(self.interval)
|
||||||
|
Loading…
Reference in New Issue
Block a user