mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-17 05:21:27 +02:00
Payment Update
Moving payment timers into the database Adding the last payment timer cycle to the stats
This commit is contained in:
+3
-2
@@ -75,7 +75,8 @@ app.get('/pool/stats', function (req, res) {
|
||||
let localCache = global.database.getCache('pool_stats_global');
|
||||
delete(localCache.minerHistory);
|
||||
delete(localCache.hashHistory);
|
||||
res.json({pool_list: pool_list, pool_statistics: localCache});
|
||||
let lastPayment = global.database.getCache('lastPaymentCycle');
|
||||
res.json({pool_list: pool_list, pool_statistics: localCache, last_payment: !lastPayment ? 0 : lastPayment});
|
||||
});
|
||||
|
||||
app.get('/pool/chart/hashrate', function (req, res) {
|
||||
@@ -601,7 +602,7 @@ adminRoutes.get('/stats', function (req, res) {
|
||||
});
|
||||
return callback(null);
|
||||
}
|
||||
], function (err) {
|
||||
], function () {
|
||||
return res.json(intCache);
|
||||
});
|
||||
});
|
||||
|
||||
+5
-4
@@ -307,7 +307,7 @@ let paymentQueue = async.queue(function (paymentDetails, callback) {
|
||||
if(!extraPaymentRound){
|
||||
setTimeout(function(){
|
||||
makePayments();
|
||||
}, 1800000);
|
||||
}, global.config.payout.timerRetry * 60 * 1000);
|
||||
}
|
||||
extraPaymentRound = true;
|
||||
return callback(false);
|
||||
@@ -342,7 +342,8 @@ let paymentQueue = async.queue(function (paymentDetails, callback) {
|
||||
|
||||
paymentQueue.drain = function(){
|
||||
extraPaymentRound = false;
|
||||
paymentTimer = setInterval(makePayments, 7200000);
|
||||
paymentTimer = setInterval(makePayments, global.config.payout.timer * 60 * 1000);
|
||||
global.database.setCache('lastPaymentCycle', Math.floor(Date.now()/1000));
|
||||
};
|
||||
|
||||
function updateShapeshiftCompletion() {
|
||||
@@ -638,7 +639,7 @@ function makePayments() {
|
||||
mixin: global.config.payout.mixIn
|
||||
};
|
||||
console.log("Paying out: " + paymentDetails.destinations.length + " people");
|
||||
paymentQueue.push(paymentDetails, function (body) {
|
||||
paymentQueue.push(paymentDetails, function (body) { //jshint ignore:line
|
||||
// This is the only section that could potentially contain multiple txns. Lets do this safely eh?
|
||||
if (body.fee && body.fee > 10) {
|
||||
debug("Made it to the SQL insert for transactions");
|
||||
@@ -683,7 +684,7 @@ function init() {
|
||||
});
|
||||
}, 60000);
|
||||
setInterval(determineBestExchange, 60000);
|
||||
paymentTimer = setInterval(makePayments, 7200000);
|
||||
console.log("Setting the payment timer to: " + global.config.payout.timer + " minutes with a: " + global.config.timerRetry + " minute delay if the wallet is out of money");
|
||||
makePayments();
|
||||
}
|
||||
|
||||
|
||||
@@ -534,5 +534,21 @@
|
||||
"item_value": "NodeJS-Pool Administration Team",
|
||||
"item_type": "string",
|
||||
"Item_desc": "Signature line for the emails."
|
||||
},
|
||||
{
|
||||
"id": 73,
|
||||
"module": "payout",
|
||||
"item": "timer",
|
||||
"item_value": "120",
|
||||
"item_type": "int",
|
||||
"Item_desc": "Number of minutes between main payment daemon cycles"
|
||||
},
|
||||
{
|
||||
"id": 74,
|
||||
"module": "payout",
|
||||
"item": "timerRetry",
|
||||
"item_value": "25",
|
||||
"item_type": "int",
|
||||
"Item_desc": "Number of minutes between payment daemon retrying due to not enough funds"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user