feat: harden cron execution recovery and expose scheduling diagnostics

Reconcile scheduled and system cron triggers, isolate concurrent executions and retain verifiable exit statistics across restarts. Add paged task history, log and script browsing, dashboard timing details and regression coverage.
This commit is contained in:
whyour committed 2026-11-17 01:01:57 +08:00
1 parent 3b6a873520
commit 8a9e70e90b
166 files changed
+18942 -1800

No files matched your search

+5 -6
View File
@@ -70,14 +70,10 @@ export const commonCronSchema = {
}
// For other absolute paths, ensure they are within the safe log directory
const normalizedValue = path.normalize(value);
const normalizedLogPath = path.normalize(config.logPath);
if (!normalizedValue.startsWith(normalizedLogPath)) {
const relative = path.relative(config.logPath, value);
if (!relative || relative === '..' || relative.startsWith('..' + path.sep) || path.isAbsolute(relative)) {
return helpers.error('string.unsafePath');
}
return value;
}
if (
@@ -97,6 +93,9 @@ export const commonCronSchema = {
'string.max': '日志名称不能超过100个字符',
'string.unsafePath': '绝对路径必须在日志目录内或使用 /dev/null',
}),
skip_if_pending: Joi.boolean().optional().allow(null),
max_queue_wait: Joi.number().integer().min(0).max(86400).allow(null),
catchup_seconds: Joi.number().integer().min(0).max(86400).allow(null),
allow_multiple_instances: Joi.number().optional().valid(0, 1).allow(null),
work_dir: Joi.string().optional().allow('').allow(null),
};