|
@@ -104,13 +104,15 @@ function getLastFile(dirPath, number, callback) {
|
|
|
for (file of files) {
|
|
|
const filePath = path.join(dirPath, file);
|
|
|
// logger.info("所有文件:",filePath)
|
|
|
- const stats = fs.promises.stat(filePath);
|
|
|
- if (stats.isFile()) {
|
|
|
- let tt = stats.birthtime.getTime()
|
|
|
- fileList.push({name: file, time: tt});
|
|
|
- logger.info("----------------所有文件:" + filePath + "时间:" + tt)
|
|
|
- }
|
|
|
+ fs.promises.stat(filePath).then((stats) =>{
|
|
|
+ if (stats.isFile()) {
|
|
|
+ let tt = stats.birthtime.getTime()
|
|
|
+ fileList.push({name: file, time: tt});
|
|
|
+ logger.info("----------------所有文件:" + filePath + "时间:" + tt)
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
for (a of fileList) {
|
|
|
const filePath = path.join(dirPath, a.name);
|
|
|
logger.info("复查:" + filePath + "\ttime:" + a.time)
|