fixes error with callback

This commit is contained in:
Zachary Boyd 2017-04-05 23:41:41 -04:00
parent 2aed4257df
commit cb49f4d08e
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "tor-router", "name": "tor-router",
"version": "3.0.4", "version": "3.0.5",
"main": "src/index.js", "main": "src/index.js",
"repository": "git@github.com:znetstar/tor-router.git", "repository": "git@github.com:znetstar/tor-router.git",
"author": "Zachary Boyd <zachary@zacharyboyd.nyc>", "author": "Zachary Boyd <zachary@zacharyboyd.nyc>",
@ -10,7 +10,7 @@
"tor-router": "bin/tor-router" "tor-router": "bin/tor-router"
}, },
"scripts": { "scripts": {
"start": "bin/tor-router -l debug -s -d -j 3", "start": "bin/tor-router -l debug -s -d -j 1",
"test": "mocha test/test.js" "test": "mocha test/test.js"
}, },
"devDependencies": { "devDependencies": {

View file

@ -23,7 +23,7 @@ class ControlServer {
socket.on('createDNSServer', this.createDNSServer.bind(this)); socket.on('createDNSServer', this.createDNSServer.bind(this));
socket.on('createInstances', (instances, callback) => { this.torPool.create(instances, (error, instances) => { socket.on('createInstances', (instances, callback) => { this.torPool.create(instances, (error, instances) => {
callback(error) callback && callback(error)
}); }); }); });
socket.on('removeInstances', (instances, callback) => { this.torPool.remove(instances, callback); }); socket.on('removeInstances', (instances, callback) => { this.torPool.remove(instances, callback); });
socket.on('newIps', () => { this.torPool.new_ips(); }); socket.on('newIps', () => { this.torPool.new_ips(); });