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
22
22
23
23
1 . password 检测规则错误。
24
24
2 . 分享链接无法隐藏知识库检索结果。
25
- 3 . IOS 低版本正则兼容问题。
25
+ 3 . IOS 低版本正则兼容问题。
26
+ 4 . 修复问答提取队列错误后,计数器未清零问题,导致问答提取队列失效。
Original file line number Diff line number Diff line change @@ -33,6 +33,16 @@ const reduceQueue = () => {
33
33
34
34
return global . qaQueueLen === 0 ;
35
35
} ;
36
+ const reduceQueueAndReturn = ( delay = 0 ) => {
37
+ reduceQueue ( ) ;
38
+ if ( delay ) {
39
+ setTimeout ( ( ) => {
40
+ generateQA ( ) ;
41
+ } , delay ) ;
42
+ } else {
43
+ generateQA ( ) ;
44
+ }
45
+ } ;
36
46
37
47
export async function generateQA ( ) : Promise < any > {
38
48
const max = global . systemEnv ?. qaMaxProcess || 10 ;
@@ -100,14 +110,12 @@ export async function generateQA(): Promise<any> {
100
110
return ;
101
111
}
102
112
if ( error ) {
103
- reduceQueue ( ) ;
104
- return generateQA ( ) ;
113
+ return reduceQueueAndReturn ( ) ;
105
114
}
106
115
107
116
// auth balance
108
117
if ( ! ( await checkTeamAiPointsAndLock ( data . teamId ) ) ) {
109
- reduceQueue ( ) ;
110
- return generateQA ( ) ;
118
+ return reduceQueueAndReturn ( ) ;
111
119
}
112
120
addLog . info ( `[QA Queue] Start` ) ;
113
121
@@ -170,8 +178,7 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
170
178
usage : chatResponse . usage
171
179
} ) ;
172
180
173
- reduceQueue ( ) ;
174
- generateQA ( ) ;
181
+ return reduceQueueAndReturn ( ) ;
175
182
} catch ( err : any ) {
176
183
addLog . error ( `[QA Queue] Error` , err ) ;
177
184
await MongoDatasetTraining . updateOne (
@@ -185,9 +192,7 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
185
192
}
186
193
) ;
187
194
188
- setTimeout ( ( ) => {
189
- generateQA ( ) ;
190
- } , 1000 ) ;
195
+ return reduceQueueAndReturn ( 1000 ) ;
191
196
}
192
197
}
193
198
You can’t perform that action at this time.
0 commit comments