Refactor: Simplify uniqPath ternary expression

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-22 04:03:10 +00:00
parent 9c4a246205
commit 92f5825499

View File

@ -507,9 +507,9 @@ export default class CronService {
let { id, command, log_name } = cron;
const uniqPath =
log_name === '/dev/null'
log_name === '/dev/null' || !log_name
? await getUniqPath(command, `${id}`)
: log_name || (await getUniqPath(command, `${id}`));
: log_name;
const logTime = dayjs().format('YYYY-MM-DD-HH-mm-ss-SSS');
const logDirPath = path.resolve(config.logPath, `${uniqPath}`);
await fs.mkdir(logDirPath, { recursive: true });