Преглед изворни кода

优化日志获取-发现长时间获取会触发100CPU,本次优化尝试解决该问题

hl пре 5 месеци
родитељ
комит
641f8e5021
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/web.js

+ 2 - 2
src/web.js

@@ -93,8 +93,8 @@ function init() {
 
                 file.getLastFile(logPath, 500, async (fileNameList, _) => {
                     // logger.info('cccccccccccccc文件:', fileNameList);
-                    // result = await file.readLastNLines(logPath, fileNameList, n);
-                    result =  await  file.getRecentLogs(logPath,fileNameList.reverse(),n);
+                    result = await file.readLastNLines(logPath, fileNameList, n);
+                    // result =  await  file.getRecentLogs(logPath,fileNameList.reverse(),n);
 
                     // logger.info('?????:', result);
                     res.send({'code': 200, 'data': result, "message": "SUCCESS"});