修复任务频繁运行通知

This commit is contained in:
whyour
2024-08-25 16:28:32 +08:00
parent 8b042d90f3
commit 65f7483688
8 changed files with 48 additions and 19 deletions
+7
View File
@@ -11,17 +11,24 @@ import { CrontabViewModel, CronViewType } from '../data/cronView';
import { initPosition } from '../data/env';
import { AuthDataType, SystemModel } from '../data/system';
import SystemService from '../services/system';
import UserService from '../services/user';
import { writeFile } from 'fs/promises';
export default async () => {
const cronService = Container.get(CronService);
const envService = Container.get(EnvService);
const dependenceService = Container.get(DependenceService);
const systemService = Container.get(SystemService);
const userService = Container.get(UserService);
// 初始化增加系统配置
await SystemModel.upsert({ type: AuthDataType.systemConfig });
await SystemModel.upsert({ type: AuthDataType.notification });
// 初始化通知配置
const notifyConfig = await userService.getNotificationMode();
await writeFile(config.systemNotifyFile, JSON.stringify(notifyConfig));
const installDependencies = () => {
// 初始化时安装所有处于安装中,安装成功,安装失败的依赖
DependenceModel.findAll({