Synchronously execution tasks in API routes #11661
Unanswered
enricoschaaf
asked this question in
Help
Replies: 1 comment
-
Hello, This is not possible. You need to wait for the "job" to finish before sending a response. Otherwise, the serverless function process will be frozen and no additional workload will be processed. ✔️
❎
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to send an email when a API route is hit, but I don't want to wait till the email is send to send a response. But when I don't await the response I get this error: Client network socket disconnected before secure TSL connection was established. I am using SendGrid/mail for this and I basically to this https://zeit.co/guides/deploying-nextjs-nodejs-and-sendgrid-with-zeit-now without await the response and it's a GraphQL API using Nexus.
Beta Was this translation helpful? Give feedback.
All reactions