Does axios not support Synchronize request? Is there any alternative?

now there is a requirement to send API requests in batches, and the number is a bit large. When the web page opens, it will prompt an error soon, because too many requests sent at the same time will be timed out if some of the requests are not sent and executed at the same time.

The axios, used by

does not seem to have the method requested by Synchronize. The following code, is there any way to make GetCombo () Synchronize request?

SetComboList(fromData, toData)
{
  fromData.forEach(element => {
      GetCombo(element.comboID).then(response => {
        let result = response.data;      
        toData.push(result);       
      });
    });
},
Jun.09,2021

restricting concurrency is the correct solution


vue.js tutorials have an example that you can refer to. Listeners section. They used lodash to limit frequent requests.
ide/computed.html" rel=" nofollow noreferrer "https://cn.vuejs.org/v2/guide.


try async/await


what about batch requests?
axios.all try
you want Synchronize. Then chain call on request
see axios official website

clipboard.png


timed out before it could be executed. This is a proposition.

first of all, is the timeout defined by you? If you define it yourself, is the timeout too short .

if you say one minute , that's good. Congratulations, you have too many requests to kill the server. Dude, your server opened for you alone. Whether others need it or not.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea9f16-69709.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea9f16-69709.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?