mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-17 05:21:27 +02:00
Fixing the timestamps in the master logger to keep them all synced to the run state time.
This commit is contained in:
+4
-4
@@ -11,7 +11,7 @@ function updateShareStats() {
|
||||
// Time based averages are worked out on ring buffers.
|
||||
// Buffer lengths? You guessed it, configured in SQL.
|
||||
// Stats timeouts are 30 seconds, so everything for buffers should be there.
|
||||
let currentTime = Math.floor(Date.now() / 1000);
|
||||
let currentTime = Date.now();
|
||||
async.waterfall([
|
||||
function (callback) {
|
||||
global.coinFuncs.getLastBlockHeader(function (body) {
|
||||
@@ -144,7 +144,7 @@ function updateShareStats() {
|
||||
cachedData.hashHistory = [];
|
||||
}
|
||||
if (cycleCount === 0){
|
||||
cachedData.hashHistory.unshift({ts: Date.now(), hs: cachedData.hash});
|
||||
cachedData.hashHistory.unshift({ts: currentTime, hs: cachedData.hash});
|
||||
if (cachedData.hashHistory.length > global.config.general.statsBufferLength) {
|
||||
while (cachedData.hashHistory.length > global.config.general.statsBufferLength) {
|
||||
cachedData.hashHistory.pop();
|
||||
@@ -175,13 +175,13 @@ function updateShareStats() {
|
||||
cachedData.minerHistory = [];
|
||||
}
|
||||
if (cycleCount === 0) {
|
||||
cachedData.hashHistory.unshift({ts: Date.now(), hs: cachedData.hash});
|
||||
cachedData.hashHistory.unshift({ts: currentTime, hs: cachedData.hash});
|
||||
if (cachedData.hashHistory.length > global.config.general.statsBufferLength) {
|
||||
while (cachedData.hashHistory.length > global.config.general.statsBufferLength) {
|
||||
cachedData.hashHistory.pop();
|
||||
}
|
||||
}
|
||||
cachedData.minerHistory.unshift({ts: Date.now(), cn: cachedData.minerCount});
|
||||
cachedData.minerHistory.unshift({ts: currentTime, cn: cachedData.minerCount});
|
||||
if (cachedData.minerHistory.length > global.config.general.statsBufferLength) {
|
||||
while (cachedData.minerHistory.length > global.config.general.statsBufferLength) {
|
||||
cachedData.minerHistory.pop();
|
||||
|
||||
Reference in New Issue
Block a user