Fixed some bugs with internal share processing

This commit is contained in:
Matt 2014-03-05 15:31:32 -07:00
parent 5c19ec9abc
commit d2f9be48d2
3 changed files with 16 additions and 6 deletions

View File

@ -90,7 +90,7 @@ module.exports = function(logger){
var authString = authorized ? 'Authorized' : 'Unauthorized ';
poolLogger.debug('client', authorized + ' [' + ip + '] ' + workerName + ':' + password);
poolLogger.debug('client', authString + ' [' + ip + '] ' + workerName + ':' + password);
callback({
error: null,
authorized: authorized,

View File

@ -8,13 +8,23 @@ module.exports = function(logger, poolConfig){
var connection;
function connect(){
var connection = connections[coin] = redis.createClient(redisConfig.port, redisConfig.host);
var reconnectTimeout;
var connection = redis.createClient(redisConfig.port, redisConfig.host);
connection.on('ready', function(){
clearTimeout(reconnectTimeout);
logger.debug('redis', 'Successfully connected to redis database');
});
connection.on('error', function(err){
logger.error('redis', 'Redis client had an error: ' + JSON.stringify(err))
});
connection.on('end', function(){
logger.warning('redis', 'Connection to redis database as been ended');
connect();
logger.error('redis', 'Connection to redis database as been ended');
logger.warning('redis', 'Trying reconnection in 3 seconds...');
reconnectTimeout = setTimeout(function(){
connect();
}, 3000);
});
}
connect();

View File

@ -22,7 +22,7 @@
"shareProcessing": {
"internal": {
"enabled": false,
"enabled": true,
"daemon": {
"host": "localhost",
"port": 19332,
@ -35,7 +35,7 @@
}
},
"mpos": {
"enabled": true,
"enabled": false,
"host": "localhost",
"port": 3306,
"user": "me",