|
@@ -120,14 +120,15 @@ function cacheLogs() {
|
|
file.checkPathSync(directoryPath)
|
|
file.checkPathSync(directoryPath)
|
|
file.getLastFile(logPath, 5, (fileNameList, _) => {
|
|
file.getLastFile(logPath, 5, (fileNameList, _) => {
|
|
logger.info('-----文件:', fileNameList);
|
|
logger.info('-----文件:', fileNameList);
|
|
- let result = file.getLatestLogEntries(logPath, fileNameList.reverse(), n);
|
|
|
|
- if (messlist.length === 0) {
|
|
|
|
- value.messlist = result
|
|
|
|
- } else {
|
|
|
|
- if (messlist[0] !== result[0]) {
|
|
|
|
|
|
+ file.getLatestLogEntries(logPath, fileNameList.reverse(), n).then((result) =>{
|
|
|
|
+ if (messlist.length === 0) {
|
|
value.messlist = result
|
|
value.messlist = result
|
|
|
|
+ } else {
|
|
|
|
+ if (messlist[0] !== result[0]) {
|
|
|
|
+ value.messlist = result
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ });
|
|
});
|
|
});
|
|
} catch (e) {
|
|
} catch (e) {
|
|
logger.info('异步缓存日志异常~~', e);
|
|
logger.info('异步缓存日志异常~~', e);
|