mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-15 19:57:07 +08:00
fix: 修复任务生命周期与调度就绪,优化执行和构建开销 (#3069)
* fix: harden task lifecycle and scheduler readiness * fix: confine log writes to the configured log directory * fix: verify complete build artifacts and untracked inputs * fix: reconcile scheduler state and make stop win startup races * fix: isolate cron generations and serialize scheduler recovery
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const crypto = require('node:crypto');
|
||||
const { execFileSync } = require('node:child_process');
|
||||
const { collectBuildFiles } = require('../docker/build-manifest.cjs');
|
||||
|
||||
const root = process.cwd();
|
||||
for (const output of ['static/build/app.js', 'static/dist/index.html']) {
|
||||
if (!fs.existsSync(path.join(root, output)))
|
||||
throw new Error(`Missing build output: ${output}`);
|
||||
}
|
||||
const git = (...args) =>
|
||||
execFileSync('git', args, { cwd: root, encoding: 'utf8' }).trim();
|
||||
const manifest = {
|
||||
version: 1,
|
||||
files: collectBuildFiles(),
|
||||
sourceCommit: git('rev-parse', 'HEAD'),
|
||||
dirty: git('status', '--porcelain', '--untracked-files=all') !== '',
|
||||
lockfileSha256: crypto
|
||||
.createHash('sha256')
|
||||
.update(fs.readFileSync('pnpm-lock.yaml'))
|
||||
.digest('hex'),
|
||||
};
|
||||
fs.writeFileSync(
|
||||
'static/build-info.json',
|
||||
JSON.stringify(manifest, null, 2) + '\n',
|
||||
);
|
||||
Reference in New Issue
Block a user