mirror of https://github.com/BTCPrivate/z-nomp.git
Fixed some bugs with internal share processing
This commit is contained in:
parent
5c19ec9abc
commit
d2f9be48d2
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue