Running functions on startup
Unanswered
LeonTM posted this in #help-forum
LeonTMOP
Hello, I am currently testing on connecting to two separate databases, I included both into the next.config.js and they both run fine on server startup. One is connectToPg() and the other is connectToMongo(). First of all, both functions are run twice, even though I set reactStrictMode to false and secondly the first function is always throwing an error on the second run because a connection through the pg.Client was already established and can't be reused. I don't know how to fix both problems, but I don't need too if I can fix just one the other one becomes obsolete. If anyone knows how to solve one or both problems, help me please. Thanks a lot