mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
V4.6.6-1 (#656)
This commit is contained in:
@@ -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'>;
|
||||
};
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user