Browse Source

将日志 与 机器人状态详情进行缓存,

hl 3 weeks ago
parent
commit
370cc2c098
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/utils/file.js

+ 2 - 2
src/utils/file.js

@@ -92,7 +92,7 @@ function delFile() {
 
 /***********************************/
 function getLastFile(dirPath, number, callback) {
-    fs.readdir(dirPath, async (err, files) => {
+    fs.readdir(dirPath,  (err, files) => {
         // logger.info(`---------------------4`)
         if (err) {
             logger.error(`无法列出目录。`, err);
@@ -104,7 +104,7 @@ function getLastFile(dirPath, number, callback) {
             for (file of files) {
                 const filePath = path.join(dirPath, file);
                 // logger.info("所有文件:",filePath)
-                const stats = await fs.promises.stat(filePath);
+                const stats =  fs.promises.stat(filePath);
                 if (stats.isFile()) {
                     let tt = stats.birthtime.getTime()
                     fileList.push({name: file, time: tt});