mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Bugfix/closing mongodb connections (#2085)
* mongodb connection issue * updating and pinning mongodb version * removing pnpm-lock.yaml * converting to a singleton * Update pnpm lock file * Downgrade mongodb --------- Co-authored-by: vinodkiran <vinodkiran@usa.net> Co-authored-by: Vinod Paidimarry <vinodkiran@outlook.in>
This commit is contained in:
committed by
GitHub
parent
b9b0c9d227
commit
ea255db15d
@@ -1,5 +1,5 @@
|
||||
import { MongoClient, Collection, Document } from 'mongodb'
|
||||
import { MongoDBChatMessageHistory } from '@langchain/community/stores/message/mongodb'
|
||||
import { MongoDBChatMessageHistory } from '@langchain/mongodb'
|
||||
import { BufferMemory, BufferMemoryInput } from 'langchain/memory'
|
||||
import { mapStoredMessageToChatMessage, AIMessage, HumanMessage, BaseMessage } from '@langchain/core/messages'
|
||||
import { convertBaseMessagetoIMessage, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
@@ -10,7 +10,7 @@ let mongoUrl: string
|
||||
|
||||
const getMongoClient = async (newMongoUrl: string) => {
|
||||
if (!mongoClientSingleton) {
|
||||
// if client doesn't exists
|
||||
// if client does not exist
|
||||
mongoClientSingleton = new MongoClient(newMongoUrl)
|
||||
mongoUrl = newMongoUrl
|
||||
return mongoClientSingleton
|
||||
|
||||
Reference in New Issue
Block a user