mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-06-02 15:32:30 +02:00
Timezone hack
This commit is contained in:
parent
6fdccc818b
commit
47c76b5583
@ -101,7 +101,7 @@ function getData() {
|
|||||||
"interval": 591202,
|
"interval": 591202,
|
||||||
"jobs": 21681,
|
"jobs": 21681,
|
||||||
"cleanFlags": 1040,
|
"cleanFlags": 1040,
|
||||||
"sharesSent": 122077,
|
"sharesSent": getRandomArbitrary(4000, 45000),
|
||||||
"sharesAccepted": 121988,
|
"sharesAccepted": 121988,
|
||||||
"sharesRejected": 89,
|
"sharesRejected": 89,
|
||||||
"solutionsAccepted": "516223196",
|
"solutionsAccepted": "516223196",
|
||||||
|
@ -8,18 +8,18 @@ module.exports = ({ define }) => {
|
|||||||
const updateScript = join(__dirname, '..', '..', '..', '..', 'backend', scriptName)
|
const updateScript = join(__dirname, '..', '..', '..', '..', 'backend', scriptName)
|
||||||
const cmd = spawn('sudo', ['bash', updateScript])
|
const cmd = spawn('sudo', ['bash', updateScript])
|
||||||
|
|
||||||
cmd.stdout.on('data', (data) => {
|
cmd.stdout.on('data', (data) => {
|
||||||
console.log(`stdout: ${data}`);
|
console.log(`stdout: ${data}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
cmd.stderr.on('data', (data) => {
|
cmd.stderr.on('data', (data) => {
|
||||||
console.error(`stderr: ${data}`);
|
console.error(`stderr: ${data}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
cmd.on('close', (code) => {
|
cmd.on('close', (code) => {
|
||||||
console.log(`child process exited with code ${code}`);
|
console.log(`child process exited with code ${code}`);
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
}, {
|
}, {
|
||||||
auth: true
|
auth: true
|
||||||
})
|
})
|
||||||
|
@ -3,6 +3,7 @@ const { exec } = require('child_process')
|
|||||||
const fs = require('fs').promises
|
const fs = require('fs').promises
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
|
const moment = require('moment')
|
||||||
|
|
||||||
module.exports = ({ define }) => {
|
module.exports = ({ define }) => {
|
||||||
define('stats', async (payload, { knex, errors, utils }) => {
|
define('stats', async (payload, { knex, errors, utils }) => {
|
||||||
@ -55,6 +56,11 @@ async function getMinerStats (errors) {
|
|||||||
return `int_${name}`
|
return `int_${name}`
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Hack to add timezone to miner date
|
||||||
|
let offset = new Date().getTimezoneOffset();
|
||||||
|
offset *= -1
|
||||||
|
received.date = moment(`${received.date}`, 'YYYY-MM-DD HH:mm:ss').utcOffset(offset).format();
|
||||||
|
|
||||||
stats.push(received);
|
stats.push(received);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user