MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / abortChatMessage

Function abortChatMessage

packages/server/src/services/chat-messages/index.ts:190–209  ·  view source on GitHub ↗
(chatId: string, chatflowid: string)

Source from the content-addressed store, hash-verified

188}
189
190const abortChatMessage = async (chatId: string, chatflowid: string) => {
191 try {
192 const appServer = getRunningExpressApp()
193 const id = `${chatflowid}_${chatId}`
194
195 if (process.env.MODE === MODE.QUEUE) {
196 await appServer.queueManager.getPredictionQueueEventsProducer().publishEvent({
197 eventName: 'abort',
198 id
199 })
200 } else {
201 appServer.abortControllerPool.abort(id)
202 }
203 } catch (error) {
204 throw new InternalFlowiseError(
205 StatusCodes.INTERNAL_SERVER_ERROR,
206 `Error: chatMessagesService.abortChatMessage - ${getErrorMessage(error)}`
207 )
208 }
209}
210
211async function getMessagesByChatflowIds(chatflowIds: string[]): Promise<ChatMessage[]> {
212 const appServer = getRunningExpressApp()

Callers

nothing calls this directly

Calls 4

getRunningExpressAppFunction · 0.90
getErrorMessageFunction · 0.90
abortMethod · 0.80

Tested by

no test coverage detected