问题
I am importing an .xlsx file, which has 6000 customers inside and I am trying to loop throught customers and make an http post
request foreach customer, but I get this error:
net::ERR_INSUFFICIENT_RESOURCES.
How can I insert these customers? They need to be passed throught my backend in order to get encrypted.
this.customers.forEach(customer => {
this.customerService
.createCustomer(customer)
.pipe(take(1))
.subscribe(() => {});
});
Only 2000 customers are imported. Any way to fix it?
Thanks.
回答1:
As i know by the way i am not 100% sure but the browser especially Chrome can't handle a very large number of requests in a short period of time,
And to solve this just try to make a bit delay after 2000
request as you mentioned that this number could be handled.
来源:https://stackoverflow.com/questions/56892378/angular-multiple-http-post-requests-give-me-error-neterr-insufficient-resour