From 5b48bb4deb1ac5bb11cfbbec643b2972eea8caec Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 25 Aug 2017 07:18:38 +0300 Subject: [PATCH] =?UTF-8?q?=D1=87=D1=83=D1=82=D1=8C=20=D0=B1=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D1=88=D0=B5=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bt/client.js | 4 +++- bt/spider.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bt/client.js b/bt/client.js index 6e56bab..7964349 100644 --- a/bt/client.js +++ b/bt/client.js @@ -15,6 +15,8 @@ class Client extends Emiter super(); this.timeout = config.downloader.timeout; this.maxConnections = config.downloader.maxConnections; + debug('timeout', this.timeout) + debug('maxConnections', this.maxConnections) this.activeConnections = 0; this.peers = new PeerQueue(this.maxConnections); this.on('download', this._download); @@ -42,7 +44,7 @@ class Client extends Emiter _download(rinfo, infohash) { - debug('start download ' + infohash.toString('hex')); + debug('start download', infohash.toString('hex'), 'connections', this.activeConnections); this.activeConnections++; var successful = false; diff --git a/bt/spider.js b/bt/spider.js index 0a76dfb..aab7048 100644 --- a/bt/spider.js +++ b/bt/spider.js @@ -227,6 +227,7 @@ class Spider extends Emiter { const path = `/sys/class/net/${config.trafficInterface}/statistics/rx_bytes` if(fs.existsSync(path)) { + trafficDebug('limitation', config.trafficMax / 1024, 'kbps/s') let traffic = 0 setInterval(() => { fs.readFile(path, (err, newTraffic) => {