mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-15 19:57:07 +08:00
* 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
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 '../shared/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;
|
|
}
|
|
};
|