D
D
Dumb as a cork2019-04-25 03:10:47
Node.js
Dumb as a cork, 2019-04-25 03:10:47

How to run a backgroud job after a post request?

I made a post request to the route I needed - a background task was launched (which will last more than one day) - I immediately received a res.json response without any timeouts.
How to implement?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Chernyshev, 2019-04-25
@IvanBlacky

In a request handler, call an asynchronous function and don't wait for a response from it inside the handler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question