Mongoose - Bun - Elysia - Mongo TCP Socket Issue

34 views Asked by At

I need help with this issue: Mongo Socket continuously closes connection, so, I’m assuming the keepAlive socket property isn’t working as it should.

error: connection 2 to host:27017 closed

Mongoose 8.2.0

Bun 1.0.28

Elysia 0.8.17

I temporarily fixed this by reading anything from DB every 30 seconds, although it may not be the best solution for a Atlas Serverless solution given that every read costs.

setInterval(async () => await App.findById("anything"), 30000)

Thanks

Additional info: I use the same Mongo user and password to connect from two different backend servers (I don't know if this could be a problem)

0

There are 0 answers