handle 102 Status (processing) in Node.js

Viewed 341

I'm issuing a request from my Server (Node8.9.0LTS) to other service, and I receive a 102 processing status code:

    const firstRes = await ajaxService.post('/data/search', params)

    <-- issue a request with a timeout -->

    ctx.data = secondRes.response.data //return the response to the client

the ajaxService returns an async function that uses axios to issue the request.

How can I write the code to issue the same request with an interval of 1 second, limited to 5 seconds (so I'll return timeout to the client) with async/await?

0 Answers
Related