deploy: v0.12 存档迁移+考古日志滚动条

This commit is contained in:
2026-06-24 03:04:38 +00:00
parent 4831505ef9
commit b4c6111516
58986 changed files with 7569452 additions and 31667 deletions
+27
View File
@@ -0,0 +1,27 @@
const privateCpuProfileName = process.env.__NEXT_PRIVATE_CPU_PROFILE;
const isCpuProfileEnabled = process.env.NEXT_CPU_PROF || privateCpuProfileName;
if (isCpuProfileEnabled) {
const { Session } = require('inspector');
const fs = require('fs');
const session = new Session();
session.connect();
session.post('Profiler.enable');
session.post('Profiler.start');
function saveProfile() {
session.post('Profiler.stop', (error, param)=>{
if (error) {
console.error('Cannot generate CPU profiling:', error);
return;
}
// Write profile to disk
const filename = `${privateCpuProfileName || 'CPU.main'}.${Date.now()}.cpuprofile`;
fs.writeFileSync(`./${filename}`, JSON.stringify(param.profile));
process.exit(0);
});
}
process.on('SIGINT', saveProfile);
process.on('SIGTERM', saveProfile);
process.on('exit', saveProfile);
}
//# sourceMappingURL=cpu-profile.js.map