When using mongodb is it possible to set the keepA...
# orm-help
k
When using mongodb is it possible to set the keepAlive, keepAliveInitialDelay on the underlining mongodb driver? https://stackoverflow.com/questions/62718415/what-is-the-use-of-nodejs-mongodb-driver-keepalive-option#:~:text=When%20keep%2[…]flagged%20as%20failed
1
h
Prisma uses the mongodb rust driver and looks like that doesn’t support the options you have mentioned. https://cs.github.com/mongodb/mongo-rust-driver/blob/f4a3806a7489dc837a2c2c3254c1dee51ef295ae/src/sync/client/mod.rs?q=keepAlive#L55 keepAlive time is set to 120s in the driver code
k
Yes very unfortunate, i have a problem where it will disconnect when doing nothing for some period of time. This problem is solved uisng keeyAlive in nodejs/mongoose
To overcome this with prisma i decided to retry the prisma queries using the middleware, not great but not much i can do
@Harshit you can read more about my usecase if youre interested here - https://github.com/prisma/prisma/discussions/15284
👍 1
In nodejs the keepAlive is jsut a boolean - https://mongodb.github.io/node-mongodb-native/4.9/interfaces/ConnectionOptions.html#keepAlive I wonder what "they" set the time to be, or if there keep alive is "infinite" (continuously pinging to keep the tcp connection alive)