mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
fix for stats exporter console errors (#166)
This commit is contained in:
1 parent
3b814eeea4
commit
233410add7
2 files changed
+20
-11
No files matched your search
@@ -20,13 +20,19 @@ module.exports = class remoteCommands {
|
||||
setInterval(async () => {
|
||||
let stats = await this.getStats();
|
||||
stats.forEach(force => {
|
||||
needle.post(`${mergedConfig.masterIP}:${mergedConfig.masterPort}/api/logStats`, {
|
||||
// I have no idea why I need to do JSON.stringify before passing it to needle.post,
|
||||
// but if you do forceData: force.data, it doesn't work...
|
||||
let request = {
|
||||
instanceID: this.config.unique,
|
||||
force: force.forceName,
|
||||
data: force.data,
|
||||
}, needleOptionsWithTokenAuthHeader, (err, resp) => {
|
||||
if(!err && resp.body && resp.body.ok == false) console.log(resp.body);
|
||||
});
|
||||
forceData: JSON.stringify(force.data),
|
||||
};
|
||||
needle.post(`${mergedConfig.masterIP}:${mergedConfig.masterPort}/api/logStats`,
|
||||
request,
|
||||
needleOptionsWithTokenAuthHeader, (err, resp) => {
|
||||
if(!err && resp.body && resp.body.ok == false) console.log("Error calling /api/logStats: " + resp.body);
|
||||
}
|
||||
);
|
||||
});
|
||||
}, 15000);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user