mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复定时任务获取日志
This commit is contained in:
parent
c769c598b8
commit
8276a19012
|
@ -196,8 +196,8 @@ export default class CronService {
|
||||||
}
|
}
|
||||||
const err = await this.killTask(doc.command);
|
const err = await this.killTask(doc.command);
|
||||||
const absolutePath = path.resolve(config.logPath, `${doc.log_path}`);
|
const absolutePath = path.resolve(config.logPath, `${doc.log_path}`);
|
||||||
const logFileExist = await fileExist(absolutePath);
|
const logFileExist = doc.log_path && (await fileExist(absolutePath));
|
||||||
if (doc.log_path && logFileExist) {
|
if (logFileExist) {
|
||||||
const str = err ? `\n${err}` : '';
|
const str = err ? `\n${err}` : '';
|
||||||
fs.appendFileSync(
|
fs.appendFileSync(
|
||||||
`${absolutePath}`,
|
`${absolutePath}`,
|
||||||
|
@ -328,7 +328,7 @@ export default class CronService {
|
||||||
}
|
}
|
||||||
|
|
||||||
const absolutePath = path.resolve(config.logPath, `${doc.log_path}`);
|
const absolutePath = path.resolve(config.logPath, `${doc.log_path}`);
|
||||||
const logFileExist = await fileExist(absolutePath);
|
const logFileExist = doc.log_path && (await fileExist(absolutePath));
|
||||||
if (logFileExist) {
|
if (logFileExist) {
|
||||||
return getFileContentByName(`${absolutePath}`);
|
return getFileContentByName(`${absolutePath}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user