fix live analysis multi-device lock

这个提交包含在:
cryptocommuniums-afk
2026-03-16 18:05:58 +08:00
父节点 13e59b8e8a
当前提交 f9db6ef590
修改 7 个文件,包含 221 行新增28 行删除

查看文件

@@ -13,6 +13,26 @@ import { createBackgroundTask, getAdminUserId, hasRecentBackgroundTaskOfType, se
import { nanoid } from "nanoid";
import { syncTutorialImages } from "../tutorialImages";
async function warmupApplicationData() {
const tasks: Array<{ label: string; run: () => Promise<unknown> }> = [
{ label: "seedTutorials", run: () => seedTutorials() },
{ label: "syncTutorialImages", run: () => syncTutorialImages() },
{ label: "seedVisionReferenceImages", run: () => seedVisionReferenceImages() },
{ label: "seedAchievementDefinitions", run: () => seedAchievementDefinitions() },
{ label: "seedAppSettings", run: () => seedAppSettings() },
];
for (const task of tasks) {
const startedAt = Date.now();
try {
await task.run();
console.log(`[startup] ${task.label} finished in ${Date.now() - startedAt}ms`);
} catch (error) {
console.error(`[startup] ${task.label} failed`, error);
}
}
}
async function scheduleDailyNtrpRefresh() {
const now = new Date();
if (now.getHours() !== 0 || now.getMinutes() > 5) {
@@ -64,12 +84,6 @@ async function findAvailablePort(startPort: number = 3000): Promise<number> {
}
async function startServer() {
await seedTutorials();
await syncTutorialImages();
await seedVisionReferenceImages();
await seedAchievementDefinitions();
await seedAppSettings();
const app = express();
const server = createServer(app);
registerMediaProxy(app);
@@ -108,6 +122,7 @@ async function startServer() {
server.listen(port, () => {
console.log(`Server running on http://localhost:${port}/`);
void warmupApplicationData();
});
setInterval(() => {