Replies: 1 comment 6 replies
-
You can just close the connection right after you have done all the interactions you needed? Some code example would help us to help you. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Your question
I am exceeding my database connections limit. Where can I destroy my database connection manually? Is one of the callbacks the right place? If so which one?
What are you trying to do
I'm using knex.js with PostgreSQL and Next.js API routes which at runtime are lambdas and as such, manually destroying the database connection is necessary. I am going to do this for my other API routes and I assume it is also necessary for my
[...nextauth].ts
route. I'm just not sure where I can do this for next-auth api calls. What I need to do in my other API routes is in afinally
block, putawait knex.destroy()
and I'm looking for where to put that in the next-auth route.Reproduction
Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
my next-auth route:
Beta Was this translation helpful? Give feedback.
All reactions