Ensure proper cleanup of the database connection in createSchema#5315
Ensure proper cleanup of the database connection in createSchema#5315HenryHengZJ merged 4 commits intoFlowiseAI:mainfrom
createSchema#5315Conversation
…thod in `MySQLRecordManager`.
|
thanks! with this fix, have you tried testing again and see if that free up the ram? |
|
@HenryHengZJ Without a fix memory consumption rises constantly, while with the fix, it always returns to the same memory usage after i run thousands api requests. I even run with 20 parallel processes at once and it seems to be working ok. Memory does rises a bit but it's not leaking (it's does not rise constantly) and after it finishes it returns to the memory consumption that was before making upsert api calls. |
|
are you able to build and run it? because |
Refactor createSchema method to avoid duplicate dataSource retrieval.
Refactor createSchema to avoid redundant dataSource retrieval.
|
@HenryHengZJ yes it should be const dataSource = await this.getDataSource(). without additional param. I used it for testing purposes but forgot to clean it out. |
fixes #4255
Potentially fixes the #4479
As per TypeORM documentation Disconnection (closing all connections in the pool) occurs when the destroy method is called.
All methods in MysqlRecordManager contains destroy call except createSchema call.
I tested locally and this keeps connection to 0 after the calls.