чуть больше информации

This commit is contained in:
Alexey Kasyanchuk
2017-08-25 07:18:38 +03:00
parent 32ff762ee8
commit 5b48bb4deb
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,8 @@ class Client extends Emiter
super(); super();
this.timeout = config.downloader.timeout; this.timeout = config.downloader.timeout;
this.maxConnections = config.downloader.maxConnections; this.maxConnections = config.downloader.maxConnections;
debug('timeout', this.timeout)
debug('maxConnections', this.maxConnections)
this.activeConnections = 0; this.activeConnections = 0;
this.peers = new PeerQueue(this.maxConnections); this.peers = new PeerQueue(this.maxConnections);
this.on('download', this._download); this.on('download', this._download);
@ -42,7 +44,7 @@ class Client extends Emiter
_download(rinfo, infohash) _download(rinfo, infohash)
{ {
debug('start download ' + infohash.toString('hex')); debug('start download', infohash.toString('hex'), 'connections', this.activeConnections);
this.activeConnections++; this.activeConnections++;
var successful = false; var successful = false;

View File

@ -227,6 +227,7 @@ class Spider extends Emiter {
const path = `/sys/class/net/${config.trafficInterface}/statistics/rx_bytes` const path = `/sys/class/net/${config.trafficInterface}/statistics/rx_bytes`
if(fs.existsSync(path)) if(fs.existsSync(path))
{ {
trafficDebug('limitation', config.trafficMax / 1024, 'kbps/s')
let traffic = 0 let traffic = 0
setInterval(() => { setInterval(() => {
fs.readFile(path, (err, newTraffic) => { fs.readFile(path, (err, newTraffic) => {