主要修复: - 修复批量上传闭包陷阱,防止文件丢失 - 添加 fileName 参数传递原始文件名,保留正确扩展名 - 添加取消检查回调,改进批量上传取消功能 其他改进: - 优化搜索功能和管理后台 - 添加 FRP 故障诊断文档 - 更新环境验证和网络检测
24 lines
738 B
TypeScript
24 lines
738 B
TypeScript
/**
|
|
* Next.js Instrumentation
|
|
*
|
|
* 这个文件在应用启动时执行,用于:
|
|
* 1. 启动临时文件定时清理任务
|
|
* 2. 初始化其他需要在启动时运行的服务
|
|
*/
|
|
|
|
export async function register() {
|
|
// 只在 Node.js 服务端运行(不在 Edge 运行时)
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
console.log('[Instrumentation] Next.js 服务端启动...')
|
|
|
|
// 启动临时文件清理任务
|
|
try {
|
|
const { startCleanupScheduler } = await import('./lib/temp-cleanup')
|
|
startCleanupScheduler()
|
|
console.log('[Instrumentation] 临时文件清理任务已启动')
|
|
} catch (error) {
|
|
console.error('[Instrumentation] 启动清理任务失败:', error)
|
|
}
|
|
}
|
|
}
|