Polling server without timer in vue is easy to crash.

is there any good polling method that does not use setInterval

Sep.17,2021

websocket;
setTimeout can also be polled;
setInterval causing a crash should be a problem with your code structure


1. Can be changed to websocket
2. Write timer in the form of setTimeout recursion (this is more accurate)
3.setInterval causes the server to crash. You can call the timer repeatedly. You can see whether the request is repeated by F12. The code problem is not the problem of timer.


personally, I think websocket will be very good, and both sides can push messages actively

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