This commit is contained in:
Archer
2023-12-27 11:07:39 +08:00
committed by GitHub
parent 86286efb54
commit 759a2330e6
182 changed files with 3099 additions and 81685 deletions

View File

@@ -1,15 +1,15 @@
import { SystemConfigsTypeEnum } from '@fastgpt/global/common/system/config/constants';
import { MongoSystemConfigs } from './schema';
import { FeConfigsType } from '@fastgpt/global/common/system/types';
import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types';
export const getFastGPTFeConfig = async () => {
export const getFastGPTConfigFromDB = async () => {
const res = await MongoSystemConfigs.findOne({
type: SystemConfigsTypeEnum.fastgpt
}).sort({
createTime: -1
});
const config: FeConfigsType = res?.value?.FeConfig || {};
const config = res?.value || {};
return config;
return config as Omit<FastGPTConfigFileType, 'systemEnv'>;
};

View File

@@ -22,7 +22,6 @@ const systemConfigSchema = new Schema({
});
try {
systemConfigSchema.index({ createTime: -1 }, { expireAfterSeconds: 90 * 24 * 60 * 60 });
systemConfigSchema.index({ type: 1 });
} catch (error) {
console.log(error);