mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-28 13:02:35 +02:00
Timezone hack
This commit is contained in:
parent
6fdccc818b
commit
47c76b5583
@ -101,7 +101,7 @@ function getData() {
|
||||
"interval": 591202,
|
||||
"jobs": 21681,
|
||||
"cleanFlags": 1040,
|
||||
"sharesSent": 122077,
|
||||
"sharesSent": getRandomArbitrary(4000, 45000),
|
||||
"sharesAccepted": 121988,
|
||||
"sharesRejected": 89,
|
||||
"solutionsAccepted": "516223196",
|
||||
|
@ -8,18 +8,18 @@ module.exports = ({ define }) => {
|
||||
const updateScript = join(__dirname, '..', '..', '..', '..', 'backend', scriptName)
|
||||
const cmd = spawn('sudo', ['bash', updateScript])
|
||||
|
||||
cmd.stdout.on('data', (data) => {
|
||||
console.log(`stdout: ${data}`);
|
||||
});
|
||||
cmd.stdout.on('data', (data) => {
|
||||
console.log(`stdout: ${data}`);
|
||||
});
|
||||
|
||||
cmd.stderr.on('data', (data) => {
|
||||
console.error(`stderr: ${data}`);
|
||||
});
|
||||
cmd.stderr.on('data', (data) => {
|
||||
console.error(`stderr: ${data}`);
|
||||
});
|
||||
|
||||
cmd.on('close', (code) => {
|
||||
console.log(`child process exited with code ${code}`);
|
||||
return;
|
||||
});
|
||||
cmd.on('close', (code) => {
|
||||
console.log(`child process exited with code ${code}`);
|
||||
return;
|
||||
});
|
||||
}, {
|
||||
auth: true
|
||||
})
|
||||
|
@ -3,6 +3,7 @@ const { exec } = require('child_process')
|
||||
const fs = require('fs').promises
|
||||
const path = require('path')
|
||||
const _ = require('lodash')
|
||||
const moment = require('moment')
|
||||
|
||||
module.exports = ({ define }) => {
|
||||
define('stats', async (payload, { knex, errors, utils }) => {
|
||||
@ -55,6 +56,11 @@ async function getMinerStats (errors) {
|
||||
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);
|
||||
}));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user