Fix uniqPath calculation in runSingle for null log_name

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-22 03:42:37 +00:00
parent fbad538db2
commit 11ec1041c7

View File

@ -509,7 +509,7 @@ export default class CronService {
const uniqPath = const uniqPath =
log_name === '/dev/null' log_name === '/dev/null'
? await getUniqPath(command, `${id}`) ? await getUniqPath(command, `${id}`)
: log_name; : log_name || (await getUniqPath(command, `${id}`));
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 });