Преглед изворни кода

Fix thread expiration update handling in postMessageHandlersFactory

Shun Miyazawa пре 9 месеци
родитељ
комит
d60e7afd49
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      apps/app/src/features/openai/server/routes/message/post-message.ts

+ 2 - 2
apps/app/src/features/openai/server/routes/message/post-message.ts

@@ -82,13 +82,13 @@ export const postMessageHandlersFactory: PostMessageHandlersFactory = (crowi) =>
         return res.apiv3Err(new ErrorV3('ThreadRelation not found'), 404);
       }
 
-      await threadRelation.updateThreadExpiration();
-
       let stream: AssistantStream;
       const useSummaryMode = req.body.summaryMode ?? false;
       const useExtendedThinkingMode = req.body.extendedThinkingMode ?? false;
 
       try {
+        await threadRelation.updateThreadExpiration();
+
         const assistant = await getOrCreateChatAssistant();
 
         const thread = await openaiClient.beta.threads.retrieve(threadId);