chengjie 4 miesięcy temu
rodzic
commit
0dd3a71e38
1 zmienionych plików z 7 dodań i 2 usunięć
  1. 7 2
      src/api/yjbdc/yjbdcController.js

+ 7 - 2
src/api/yjbdc/yjbdcController.js

@@ -187,6 +187,11 @@ export async function GenerateArticle(ctx) {
187 187
         let articleStyle = params.ArticleStyle;
188 188
 
189 189
         if (words){
190
+
191
+            //生成中
192
+            result = { errcode: 10000, result: "-2" };
193
+            globalCache.set(url, result, config.BufferMemoryTime);
194
+            console.log("生成中,暂停生成60秒");
190 195
             
191 196
             const menuConfig=constantClass.GetYJBDCGenerateConfig();
192 197
         
@@ -337,8 +342,8 @@ export async function GenerateArticle(ctx) {
337 342
                 result3.IsNew=true;
338 343
                 result = { errcode: 10000, result: result3 };
339 344
 
340
-                globalCache.set(url, result, config.BufferMemoryTime);
341
-                console.log("缓存60秒");
345
+                globalCache.delete(url);
346
+                console.log("删除缓存,恢复生成");
342 347
             }
343 348
             catch(err){
344 349
                 console.error("AI生成错误:"+err);