mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
修复脚本和日志列表获取软链接循环失败
This commit is contained in:
parent
6ca28190b0
commit
445dee00f7
|
@ -30,7 +30,7 @@ export async function getLastModifyFilePath(dir: string) {
|
||||||
|
|
||||||
arr.forEach(async (item) => {
|
arr.forEach(async (item) => {
|
||||||
const fullpath = path.join(dir, item);
|
const fullpath = path.join(dir, item);
|
||||||
const stats = await fs.stat(fullpath);
|
const stats = await fs.lstat(fullpath);
|
||||||
if (stats.isFile()) {
|
if (stats.isFile()) {
|
||||||
if (stats.mtimeMs >= 0) {
|
if (stats.mtimeMs >= 0) {
|
||||||
filePath = fullpath;
|
filePath = fullpath;
|
||||||
|
@ -257,7 +257,7 @@ export async function readDirs(
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const subPath = path.join(dir, file);
|
const subPath = path.join(dir, file);
|
||||||
const stats = await fs.stat(subPath);
|
const stats = await fs.lstat(subPath);
|
||||||
const key = path.join(relativePath, file);
|
const key = path.join(relativePath, file);
|
||||||
|
|
||||||
if (blacklist.includes(file) || stats.isSymbolicLink()) {
|
if (blacklist.includes(file) || stats.isSymbolicLink()) {
|
||||||
|
@ -300,7 +300,7 @@ export async function readDir(
|
||||||
.filter((x) => !blacklist.includes(x))
|
.filter((x) => !blacklist.includes(x))
|
||||||
.map(async (file: string) => {
|
.map(async (file: string) => {
|
||||||
const subPath = path.join(dir, file);
|
const subPath = path.join(dir, file);
|
||||||
const stats = await fs.stat(subPath);
|
const stats = await fs.lstat(subPath);
|
||||||
const key = path.join(relativePath, file);
|
const key = path.join(relativePath, file);
|
||||||
return {
|
return {
|
||||||
title: file,
|
title: file,
|
||||||
|
|
|
@ -515,7 +515,7 @@ export default class CronService {
|
||||||
files.map(async (x) => ({
|
files.map(async (x) => ({
|
||||||
filename: x,
|
filename: x,
|
||||||
directory: relativeDir.replace(config.logPath, ''),
|
directory: relativeDir.replace(config.logPath, ''),
|
||||||
time: (await fs.stat(`${dir}/${x}`)).mtime.getTime(),
|
time: (await fs.lstat(`${dir}/${x}`)).mtime.getTime(),
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
).sort((a, b) => b.time - a.time);
|
).sort((a, b) => b.time - a.time);
|
||||||
|
|
|
@ -371,7 +371,7 @@ export default class SubscriptionService {
|
||||||
files.map(async (x) => ({
|
files.map(async (x) => ({
|
||||||
filename: x,
|
filename: x,
|
||||||
directory: relativeDir.replace(config.logPath, ''),
|
directory: relativeDir.replace(config.logPath, ''),
|
||||||
time: (await fs.stat(`${dir}/${x}`)).mtime.getTime(),
|
time: (await fs.lstat(`${dir}/${x}`)).mtime.getTime(),
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
).sort((a, b) => b.time - a.time);
|
).sort((a, b) => b.time - a.time);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user