perf: wechat channel (#6800)

* perf: wechat channel

* fix: review
This commit is contained in:
Archer
2026-04-22 16:29:40 +08:00
committed by GitHub
parent b2cfada959
commit a5cd822942
13 changed files with 808 additions and 172 deletions
+2
View File
@@ -160,6 +160,8 @@ CHECK_INTERNAL_IP=false
APP_FOLDER_MAX_AMOUNT=1000
# 数据集文件夹最大数量
DATASET_FOLDER_MAX_AMOUNT=1000
# 微信渠道 poll worker 并发数(默认 1000),需 ≥ online channel 数;channel 数超过该值时消息延迟会线性恶化
WECHAT_CHANNEL_CONCURRENCY=1000
# ==================== 上传与账号策略 ====================
# 最大上传文件大小(MB
@@ -10,10 +10,9 @@ import { useDebounceEffect, useMount } from 'ahooks';
import { v1Workflow2V2 } from '@/web/core/workflow/adapt';
import { defaultAppSelectFileConfig } from '@fastgpt/global/core/app/constants';
import { form2AppWorkflow, appWorkflow2Form } from './utils';
const Edit = dynamic(() => import('./Edit'));
const Logs = dynamic(() => import('../../Logs/index'));
const PublishChannel = dynamic(() => import('../../Publish'));
import PublishChannel from '../../Publish';
import Logs from '../../Logs';
import Edit from './Edit';
const SimpleEdit = () => {
const { t } = useTranslation();
@@ -6,6 +6,7 @@ import { NextAPI } from '@/service/middleware/entry';
import { addAuditLog } from '@fastgpt/service/support/user/audit/util';
import { AuditEventEnum } from '@fastgpt/global/support/user/audit/constants';
import { getI18nAppType } from '@fastgpt/service/support/user/audit/util';
import { stopWechatPolling } from '@fastgpt/service/support/outLink/wechat/mq';
export type OutLinkDeleteQuery = {
id: string;
@@ -25,7 +26,15 @@ async function handler(
per: OwnerPermissionVal
});
await MongoOutLink.findByIdAndDelete(id);
const outlink = await MongoOutLink.findById(id);
if (outlink && outlink.type === 'wechat') {
await stopWechatPolling(outlink.shareId).catch((error) => {
console.warn('Stop wechat polling failed', error);
});
}
await outlink?.deleteOne();
(async () => {
addAuditLog({