|
@@ -37,7 +37,7 @@ function getApp(key) {
|
|
id: -1,
|
|
id: -1,
|
|
port: -1,
|
|
port: -1,
|
|
childProcess: undefined,
|
|
childProcess: undefined,
|
|
- nowBalance: 0.0,
|
|
|
|
|
|
+ nowBalance: -1,
|
|
messlist: [],
|
|
messlist: [],
|
|
threadStatus: RobotStatus.STOPPED,
|
|
threadStatus: RobotStatus.STOPPED,
|
|
errorMessage: "成功",
|
|
errorMessage: "成功",
|
|
@@ -260,7 +260,7 @@ async function run(param) {
|
|
robotStatus(app)
|
|
robotStatus(app)
|
|
app.childProcess = undefined
|
|
app.childProcess = undefined
|
|
app.status = 0
|
|
app.status = 0
|
|
- app.nowBalance = 0.0
|
|
|
|
|
|
+ app.nowBalance = 0
|
|
});
|
|
});
|
|
app.threadStatus = RobotStatus.RUNNING
|
|
app.threadStatus = RobotStatus.RUNNING
|
|
robotStatus(app)
|
|
robotStatus(app)
|
|
@@ -432,10 +432,11 @@ function robotAmount(app) {
|
|
http.request_get(`${accUrl}/account`, {...config.headers})
|
|
http.request_get(`${accUrl}/account`, {...config.headers})
|
|
.then((data) => {
|
|
.then((data) => {
|
|
var d = JSON.parse(data)
|
|
var d = JSON.parse(data)
|
|
|
|
+ app.nowBalance = d.now_balance
|
|
//余额有变动上报一次
|
|
//余额有变动上报一次
|
|
// logger.info(`余额当前:${(app.nowBalance + "")}--${(d.now_balance + "")}--`);
|
|
// logger.info(`余额当前:${(app.nowBalance + "")}--${(d.now_balance + "")}--`);
|
|
- if ((app.nowBalance + "") !== (d.now_balance + "")) {
|
|
|
|
- app.nowBalance = d.now_balance
|
|
|
|
|
|
+ // if ((app.nowBalance + "") !== (d.now_balance + "")) {
|
|
|
|
+
|
|
// http.request_post(`${config.reportedUrl}/report/amountReport`, {
|
|
// http.request_post(`${config.reportedUrl}/report/amountReport`, {
|
|
// "robotId": app.id,
|
|
// "robotId": app.id,
|
|
// "amount": d.now_balance
|
|
// "amount": d.now_balance
|
|
@@ -447,7 +448,7 @@ function robotAmount(app) {
|
|
// }).catch((error) => {
|
|
// }).catch((error) => {
|
|
// logger.error(`#####################汇报:余额上报错误: ${error.message}`); // 处理可能发生的错误
|
|
// logger.error(`#####################汇报:余额上报错误: ${error.message}`); // 处理可能发生的错误
|
|
// });
|
|
// });
|
|
- }
|
|
|
|
|
|
+ // }
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
logger.error(`#####################汇报:余额接口请求失败: ${error.message}`); // 处理可能发生的错误
|
|
logger.error(`#####################汇报:余额接口请求失败: ${error.message}`); // 处理可能发生的错误
|
|
});
|
|
});
|