|
@@ -91,14 +91,17 @@ function init() {
|
|
// 将相对路径转换为绝对路径
|
|
// 将相对路径转换为绝对路径
|
|
const directoryPath = path.resolve(logPath);
|
|
const directoryPath = path.resolve(logPath);
|
|
try {
|
|
try {
|
|
|
|
+ logger.info(`---------------------2`)
|
|
file.checkPathSync(directoryPath)
|
|
file.checkPathSync(directoryPath)
|
|
-
|
|
|
|
|
|
+ logger.info(`---------------------3`)
|
|
file.getLastFile(logPath, 5, async (fileNameList, _) => {
|
|
file.getLastFile(logPath, 5, async (fileNameList, _) => {
|
|
|
|
+ logger.info(`---------------------5`)
|
|
// logger.info('cccccccccccccc文件:', fileNameList);
|
|
// logger.info('cccccccccccccc文件:', fileNameList);
|
|
// result = await file.readLastNLines(logPath, fileNameList, n);
|
|
// result = await file.readLastNLines(logPath, fileNameList, n);
|
|
result = await file.getRecentLogs(logPath,fileNameList.reverse(),n);
|
|
result = await file.getRecentLogs(logPath,fileNameList.reverse(),n);
|
|
|
|
|
|
// logger.info('?????:', result);
|
|
// logger.info('?????:', result);
|
|
|
|
+ logger.info(`---------------------6`)
|
|
res.send({'code': 200, 'data': result, "message": "SUCCESS"});
|
|
res.send({'code': 200, 'data': result, "message": "SUCCESS"});
|
|
});
|
|
});
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -129,7 +132,6 @@ function init() {
|
|
})
|
|
})
|
|
//启动-仓位检查
|
|
//启动-仓位检查
|
|
app.get('/searchPositions', (req, res) => {
|
|
app.get('/searchPositions', (req, res) => {
|
|
- logger.info(`---------------------2`)
|
|
|
|
const param = req.query;
|
|
const param = req.query;
|
|
logger.info(JSON.stringify(param));
|
|
logger.info(JSON.stringify(param));
|
|
robot.searchPositions(param)
|
|
robot.searchPositions(param)
|
|
@@ -137,7 +139,7 @@ function init() {
|
|
})
|
|
})
|
|
// 新策略-返回机器人状态
|
|
// 新策略-返回机器人状态
|
|
app.get('/predictorState', (req, res) => {
|
|
app.get('/predictorState', (req, res) => {
|
|
- logger.info(`---------------------3`)
|
|
|
|
|
|
+
|
|
// const param = req.query;
|
|
// const param = req.query;
|
|
// logger.info(JSON.stringify(param));
|
|
// logger.info(JSON.stringify(param));
|
|
// let data = robot.predictorState(param)
|
|
// let data = robot.predictorState(param)
|