|
@@ -252,6 +252,11 @@ async function run(param) {
|
|
});
|
|
});
|
|
app.childProcess.on('error', (err) => {
|
|
app.childProcess.on('error', (err) => {
|
|
console.error('子程序-异常:', err);
|
|
console.error('子程序-异常:', err);
|
|
|
|
+ app.threadStatus = RobotStatus.ERROR
|
|
|
|
+ app.errorMessage = `子线程发生异常!! ${err}`
|
|
|
|
+ robotStatus(app)
|
|
|
|
+ app.childProcess = undefined
|
|
|
|
+ app.status = 0
|
|
});
|
|
});
|
|
app.childProcess.on('exit', (code, signal) => {
|
|
app.childProcess.on('exit', (code, signal) => {
|
|
logger.info(`子进程退出-exit,退出码: ${code}, 信号: ${signal}`);
|
|
logger.info(`子进程退出-exit,退出码: ${code}, 信号: ${signal}`);
|
|
@@ -439,17 +444,17 @@ function robotAmount(app) {
|
|
// logger.info(`余额当前:${(app.nowBalance + "")}--${(d.now_balance + "")}--`);
|
|
// logger.info(`余额当前:${(app.nowBalance + "")}--${(d.now_balance + "")}--`);
|
|
// if ((app.nowBalance + "") !== (d.now_balance + "")) {
|
|
// if ((app.nowBalance + "") !== (d.now_balance + "")) {
|
|
|
|
|
|
- // http.request_post(`${config.reportedUrl}/report/amountReport`, {
|
|
|
|
- // "robotId": app.id,
|
|
|
|
- // "amount": d.now_balance
|
|
|
|
- // }, {...config.headers})
|
|
|
|
- // .then((data2) => {
|
|
|
|
- // logger.info('上报响应', data2);
|
|
|
|
- // logger.info('#####################汇报:余额:pid:', app.childProcess.pid, '机器人id:', app.id, '机器人本地余额:', app.nowBalance, '实际余额:', d.now_balance);
|
|
|
|
- // app.nowBalance = d.now_balance
|
|
|
|
- // }).catch((error) => {
|
|
|
|
- // logger.error(`#####################汇报:余额上报错误: ${error.message}`); // 处理可能发生的错误
|
|
|
|
- // });
|
|
|
|
|
|
+ // http.request_post(`${config.reportedUrl}/report/amountReport`, {
|
|
|
|
+ // "robotId": app.id,
|
|
|
|
+ // "amount": d.now_balance
|
|
|
|
+ // }, {...config.headers})
|
|
|
|
+ // .then((data2) => {
|
|
|
|
+ // logger.info('上报响应', data2);
|
|
|
|
+ // logger.info('#####################汇报:余额:pid:', app.childProcess.pid, '机器人id:', app.id, '机器人本地余额:', app.nowBalance, '实际余额:', d.now_balance);
|
|
|
|
+ // app.nowBalance = d.now_balance
|
|
|
|
+ // }).catch((error) => {
|
|
|
|
+ // logger.error(`#####################汇报:余额上报错误: ${error.message}`); // 处理可能发生的错误
|
|
|
|
+ // });
|
|
// }
|
|
// }
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
logger.error(`#####################汇报:余额接口请求失败: ${error.message}`); // 处理可能发生的错误
|
|
logger.error(`#####################汇报:余额接口请求失败: ${error.message}`); // 处理可能发生的错误
|