tRPC (on nextjs) kill not awaited Prisma #1474
-
I have a mutation that changes data in the extern system (for example From my UI I public post on I want save changes that make my system in I expected that this code makes it
but unfortunately, after resolving this request, tRPC kill Prisma, for save data in the database need await Prisma, but it's is slow How can return response from tRPC, but continue to execute remaining promises? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don't think this has anything to do with tRPC, but rather with your lambda functions environment being killed as soon as the response is sent and therefore killing the connection to the DB before this mutation has been done. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, Prisma doesn't work as I expected
don't start promise, promise started only after call .then() I don't want use the correct version of initial code
|
Beta Was this translation helpful? Give feedback.
I'm sorry, Prisma doesn't work as I expected
don't start promise, promise started only after call .then()
I don't want use
await prisma.post.create()
but can useprisma.post.create().then()
or prisma.$transaction([prisma.post.create()])the correct version of initial code