mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 09:45:36 +08:00
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:
1 parent
3b6a873520
commit
8a9e70e90b
166 files changed
+18942
-1800
No files matched your search
@@ -241,6 +241,21 @@ test('failed download persists its failure without stopping the panel and can be
|
||||
assert.equal((await finished(f.tmp)).status, 'ready');
|
||||
});
|
||||
|
||||
test('a terminal state published between the status read and PID probe wins', async (t) => {
|
||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-finished-job-'));
|
||||
t.after(() => fs.rm(tmp, { recursive: true, force: true }));
|
||||
const file = path.join(tmp, 'panel-upgrade.json');
|
||||
const running = { id: 'finishing', status: 'running', pid: 123456, startedAt: 1 };
|
||||
await fs.writeFile(file, JSON.stringify(running));
|
||||
const kill = process.kill;
|
||||
t.mock.method(process, 'kill', (pid, signal) => {
|
||||
if (pid !== running.pid || signal !== 0) return kill(pid, signal);
|
||||
syncFs.writeFileSync(file, JSON.stringify({ ...running, status: 'ready' }));
|
||||
throw Object.assign(new Error('worker exited'), { code: 'ESRCH' });
|
||||
});
|
||||
assert.equal((await getStatus(tmp)).status, 'ready');
|
||||
});
|
||||
|
||||
test('orphaned jobs become retryable and status log reads are bounded', async (t) => {
|
||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), 'ql-orphan-job-'));
|
||||
t.after(() => fs.rm(tmp, { recursive: true, force: true }));
|
||||
|
||||
Reference in new issue
Block a user