|
@@ -96,7 +96,7 @@ function reportAmount() {
|
|
|
// 问题: http请求过多,加上请求耗时,容易造成拥堵,所以开启线程异步缓存 机器人程序日志,机器人状态详情信息,http直接返回数据
|
|
|
function cacheLogs() {
|
|
|
// 设置定时器,每隔一定时间(比如每隔5秒)发送一次GET请求
|
|
|
- const intervalInMilliseconds = 1000 * 2;
|
|
|
+ const intervalInMilliseconds = 1000 * 5;
|
|
|
setInterval(() => {
|
|
|
// logger.info('当前2',robot.appMap);
|
|
|
robot.appMap.forEach((value, key) => {
|
|
@@ -140,7 +140,7 @@ function cacheLogs() {
|
|
|
|
|
|
function cachePredictorState() {
|
|
|
// 设置定时器,每隔一定时间(比如每隔5秒)发送一次GET请求
|
|
|
- const intervalInMilliseconds = 1500;
|
|
|
+ const intervalInMilliseconds = 1500*2;
|
|
|
setInterval(() => {
|
|
|
// logger.info('当前2',robot.appMap);
|
|
|
var config = getRustConfig()
|
|
@@ -156,6 +156,9 @@ function cachePredictorState() {
|
|
|
var accUrl = "http://127.0.0.1:" + port
|
|
|
http.request_get(`${accUrl}/predictor_state`, {...config.headers})
|
|
|
.then((data) => {
|
|
|
+ if(data.length < 50){
|
|
|
+ logger.info(`可能出错的data~~: ${data}`)
|
|
|
+ }
|
|
|
let result = JSON.parse(data);
|
|
|
if (predictorState.length === 0) {
|
|
|
value.predictorState = result
|