From 95c11b4427b7fb4a95d9c3f9d928d44345f2729f Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 25 Aug 2017 06:46:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=81=D0=BE=D0=B5=D0=B4=D0=B8=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9=20=D0=B4=D0=BB=D1=8F=20=D0=B4=D0=BE=D1=83=D0=BD?= =?UTF-8?q?=D0=BB=D0=BE=D0=B4=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bt/client.js | 6 +++--- config.js | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bt/client.js b/bt/client.js index f2904b6..6e56bab 100644 --- a/bt/client.js +++ b/bt/client.js @@ -7,14 +7,14 @@ var net = require('net'); var PeerQueue = require('./peer-queue'); var Wire = require('./wire'); const debug = require('debug')('downloader'); - +const config = require('../config') class Client extends Emiter { constructor(options) { super(); - this.timeout = 5000; - this.maxConnections = 200; + this.timeout = config.downloader.timeout; + this.maxConnections = config.downloader.maxConnections; this.activeConnections = 0; this.peers = new PeerQueue(this.maxConnections); this.on('download', this._download); diff --git a/config.js b/config.js index 2274209..85e9335 100644 --- a/config.js +++ b/config.js @@ -29,6 +29,11 @@ let config = { cpuInterval: 10, }, + downloader: { + maxConnections: 2000, + timeout: 5000 + } + cleanup: true, cleanupDiscLimit: 7 * 1024 * 1024 * 1024, spaceQuota: false,