I'd like to ask a question about js timer. I have several ajax interfaces.

problem description

I"d like to ask a question about js timers. I have several ajax interfaces. What"s the difference between defining a settimeout for each interface and merging them into a scheduled task? What kind of performance will be better?

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Jan.26,2022

it is recommended to define a timer in success success, so that another request will not be initiated because the last API did not return data in time, to prevent blocking


1. Whether the data in each interface needs to be associated, if you need association, you can use timeout to go down one by one. If you do not need association, you can directly cycle through interval. If you think the loop frequency is too fast, you can consider putting it into worker for
2, or combine Promise or async/await to see if it can meet the requirements and better optimize the logic

.
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-1eb096e-22ed.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-1eb096e-22ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?