mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 01:39:52 +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
@@ -0,0 +1,26 @@
|
||||
// Observe the first executable location in the entry file. Preloads, the TS
|
||||
// compiler and ESM dependency evaluation can all run before that location.
|
||||
const { Session, url } = require('inspector');
|
||||
const { pathToFileURL } = require('url');
|
||||
const { writeFileSync } = require('fs');
|
||||
|
||||
module.exports = function observeScriptStart(entry, marker) {
|
||||
if (!entry || !marker || url()) return;
|
||||
const session = new Session();
|
||||
try {
|
||||
session.connect();
|
||||
const target = pathToFileURL(entry).href;
|
||||
session.post('Debugger.enable');
|
||||
session.post('Debugger.setBreakpointByUrl', { url: target, lineNumber: 0 }, (err, bp) => {
|
||||
if (err || !bp) { session.disconnect(); return; }
|
||||
session.on('Debugger.paused', ({ params }) => {
|
||||
if (params.hitBreakpoints?.includes(bp.breakpointId)) {
|
||||
try { writeFileSync(marker, String(Date.now()), { flag: 'wx', mode: 0o600 }); } catch {}
|
||||
session.disconnect();
|
||||
} else {
|
||||
session.post('Debugger.resume');
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch { try { session.disconnect(); } catch {} }
|
||||
};
|
||||
Reference in new issue
Block a user