mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-12 14:05:38 +08:00
Refactor: Simplify uniqPath ternary expression
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
9c4a246205
commit
92f5825499
|
|
@ -507,9 +507,9 @@ export default class CronService {
|
||||||
let { id, command, log_name } = cron;
|
let { id, command, log_name } = cron;
|
||||||
|
|
||||||
const uniqPath =
|
const uniqPath =
|
||||||
log_name === '/dev/null'
|
log_name === '/dev/null' || !log_name
|
||||||
? await getUniqPath(command, `${id}`)
|
? await getUniqPath(command, `${id}`)
|
||||||
: log_name || (await getUniqPath(command, `${id}`));
|
: log_name;
|
||||||
const logTime = dayjs().format('YYYY-MM-DD-HH-mm-ss-SSS');
|
const logTime = dayjs().format('YYYY-MM-DD-HH-mm-ss-SSS');
|
||||||
const logDirPath = path.resolve(config.logPath, `${uniqPath}`);
|
const logDirPath = path.resolve(config.logPath, `${uniqPath}`);
|
||||||
await fs.mkdir(logDirPath, { recursive: true });
|
await fs.mkdir(logDirPath, { recursive: true });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user