File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
docSite/content/zh-cn/docs/development/upgrading
projects/app/src/service/events Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,5 @@ weight: 795
2222
23231 . password 检测规则错误。
24242 . 分享链接无法隐藏知识库检索结果。
25- 3 . IOS 低版本正则兼容问题。
25+ 3 . IOS 低版本正则兼容问题。
26+ 4 . 修复问答提取队列错误后,计数器未清零问题,导致问答提取队列失效。
Original file line number Diff line number Diff line change @@ -33,6 +33,16 @@ const reduceQueue = () => {
3333
3434 return global . qaQueueLen === 0 ;
3535} ;
36+ const reduceQueueAndReturn = ( delay = 0 ) => {
37+ reduceQueue ( ) ;
38+ if ( delay ) {
39+ setTimeout ( ( ) => {
40+ generateQA ( ) ;
41+ } , delay ) ;
42+ } else {
43+ generateQA ( ) ;
44+ }
45+ } ;
3646
3747export async function generateQA ( ) : Promise < any > {
3848 const max = global . systemEnv ?. qaMaxProcess || 10 ;
@@ -100,14 +110,12 @@ export async function generateQA(): Promise<any> {
100110 return ;
101111 }
102112 if ( error ) {
103- reduceQueue ( ) ;
104- return generateQA ( ) ;
113+ return reduceQueueAndReturn ( ) ;
105114 }
106115
107116 // auth balance
108117 if ( ! ( await checkTeamAiPointsAndLock ( data . teamId ) ) ) {
109- reduceQueue ( ) ;
110- return generateQA ( ) ;
118+ return reduceQueueAndReturn ( ) ;
111119 }
112120 addLog . info ( `[QA Queue] Start` ) ;
113121
@@ -170,8 +178,7 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
170178 usage : chatResponse . usage
171179 } ) ;
172180
173- reduceQueue ( ) ;
174- generateQA ( ) ;
181+ return reduceQueueAndReturn ( ) ;
175182 } catch ( err : any ) {
176183 addLog . error ( `[QA Queue] Error` , err ) ;
177184 await MongoDatasetTraining . updateOne (
@@ -185,9 +192,7 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
185192 }
186193 ) ;
187194
188- setTimeout ( ( ) => {
189- generateQA ( ) ;
190- } , 1000 ) ;
195+ return reduceQueueAndReturn ( 1000 ) ;
191196 }
192197}
193198
You can’t perform that action at this time.
0 commit comments