настройки паучка

This commit is contained in:
Alexey Kasyanchuk
2017-01-21 00:43:50 +03:00
parent 4a2dcd7d36
commit 00d4cd79da
3 changed files with 13 additions and 4 deletions

View File

@ -6,6 +6,7 @@ const bencode = require('bencode')
const {Table, Node} = require('./table')
const Token = require('./token')
const cpuUsage = require('./cpu-usage')
const config = require('../config')
const bootstraps = [{
address: 'router.bittorrent.com',
@ -40,9 +41,9 @@ class Spider extends Emiter {
this.client = client
this.ignore = false; // ignore all requests
this.walkInterval = 5;
this.cpuLimit = 0;
this.cpuInterval = 10;
this.walkInterval = config.spider.walkInterval;
this.cpuLimit = config.spider.cpuLimit;
this.cpuInterval = config.spider.cpuInterval;
}
send(message, address) {