New license (#4809)

* feat: new-license

* perf: volumn watch

* Set use client
This commit is contained in:
Archer
2025-05-14 13:55:09 +08:00
committed by GitHub
parent bd93f28d6f
commit cba8f773fe
34 changed files with 227 additions and 93 deletions

View File

@@ -7,6 +7,7 @@ import { debounce } from 'lodash';
import { MongoAppTemplate } from '@fastgpt/service/core/app/templates/templateSchema';
import { getAppTemplatesAndLoadThem } from '@fastgpt/templates/register';
import { watchSystemModelUpdate } from '@fastgpt/service/core/ai/config/utils';
import { SystemConfigsTypeEnum } from '@fastgpt/global/common/system/config/constants';
export const startMongoWatch = async () => {
reloadConfigWatch();
@@ -21,7 +22,11 @@ const reloadConfigWatch = () => {
changeStream.on('change', async (change) => {
try {
if (change.operationType === 'insert') {
if (
(change.operationType === 'insert' &&
change.fullDocument.type === SystemConfigsTypeEnum.fastgptPro) ||
change.operationType === 'update'
) {
await initSystemConfig();
console.log('refresh system config');
}