(chatId: string, chatflowid: string)
| 188 | } |
| 189 | |
| 190 | const 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 | |
| 211 | async function getMessagesByChatflowIds(chatflowIds: string[]): Promise<ChatMessage[]> { |
| 212 | const appServer = getRunningExpressApp() |
nothing calls this directly
no test coverage detected