Hi everyone, I seem to be having some trouble re-using MongoDB Atlas connections in repeated calls to lambdas built using Serverless Stack. Has anyone else had this issue?
m
Mr.9715
05/31/2021, 4:01 PM
Hi, I used mongo Atlas, without any issues. Can you help me re-create the scenario? I am sharing my code, I have used a mongo connection and cached it. Let me know if this works for you.
f
Frank
05/31/2021, 5:48 PM
@Jay Can we take a look at the code and put together an example with MongoDB?
j
Jay
06/01/2021, 2:14 PM
Yup, I’ll take a look.
p
Pranav Tadikonda
06/03/2021, 9:54 PM
From what it seems, the deployed APIs reuse connections fine
Pranav Tadikonda
06/03/2021, 9:55 PM
Just the hot reloading
j
Jay
06/04/2021, 1:05 AM
@Pranav Tadikonda Is it causing errors when you are testing locally? SST runs a separate Node.js process per invocation. So I can see the caching approach from the code sample above might not work. But let me know whats going on and we’ll look into fixing it.