|
@@ -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});
|