mirror of
https://github.com/whyour/qinglong.git
synced 2026-11-30 16:27:21 +08:00
Return committed trigger IDs and add CLI wait and trigger-specific logs while preserving API, CLI, transaction, deduplication and unknown-result semantics. Move scheduling, lifecycle, settlement, queries and legacy adapters into back/cron; remove obsolete internal import paths and circular dependencies. Apply project formatting across the repository, cover CJS/MJS in formatting hooks, add prettier:check and require formatting checks in AGENTS.md. Validation: backend build; 1398 backend/frontend tests passed (17 platform skips); 327 CLI tests passed (6 platform skips); 670 files pass format checks.
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import Logger from './logger';
|
|
import { EnvModel } from '../data/env';
|
|
import { CrontabModel } from '../data/cron';
|
|
import { DependenceModel } from '../data/dependence';
|
|
import { AppModel } from '../data/open';
|
|
import { SystemModel } from '../data/system';
|
|
import { SubscriptionModel } from '../data/subscription';
|
|
import { CrontabViewModel } from '../data/cronView';
|
|
import { CrontabStatModel } from '../data/cronStats';
|
|
import { RunningInstanceModel } from '../data/runningInstance';
|
|
import { sequelize } from '../data';
|
|
import { migrateSchema } from '../data/schemaMigrations';
|
|
|
|
export default async () => {
|
|
try {
|
|
await CrontabModel.sync();
|
|
await DependenceModel.sync();
|
|
await AppModel.sync();
|
|
await SystemModel.sync();
|
|
await EnvModel.sync();
|
|
await SubscriptionModel.sync();
|
|
await CrontabViewModel.sync();
|
|
await CrontabStatModel.sync();
|
|
await RunningInstanceModel.sync();
|
|
|
|
await migrateSchema(sequelize);
|
|
|
|
Logger.info('[boot] DB loaded');
|
|
} catch (error) {
|
|
Logger.error('[boot] DB load failed', error);
|
|
throw error;
|
|
}
|
|
};
|