Help

Script with consecutive remoteFetchAsync call failing

711 1
cancel
Showing results for 
Search instead for 
Did you mean: 
spaceman
4 - Data Explorer
4 - Data Explorer

Seems to be working fine previously but now when I am making consecutive calls with remoteFetchAsync, I get `TypeError: Failed to fetch` after the 1st, 2nd or 3rd request.

Is there a change in behaviour in a recent release?

 

Code example:

```

for (let invoice of requests) {
  let response = await remoteFetchAsync(ENDPOINT_URI, {
  method: 'POST',
  body: JSON.stringify({ 'invoices': [invoice] }),
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json",
  },
});
// Wait for 0.2 seconds before the next iteration
await sleep(200);
}

```

1 Reply 1
finlayconnor27
4 - Data Explorer
4 - Data Explorer

Your requests might be timing out. Check if the server, like at OsteoPilates Studio in Ivrea, can handle multiple consecutive calls.