You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setInterval(callback, delay) runs after delay milliseconds. If the callback takes more time to run than these delay milliseonds (because of slower API/database responses), the program will break.
In context of this program, it only takes about 15 seconds for the async callback to run once. The delay is set to 2 minutes to avoid said problem. This 2-minute delay gives callback plenty of time to finish. But this is not efficient as the program is sitting idle rest of the time.
A probable solution is to use the equivalent of a sleep function in Python details of which can be found here.
The text was updated successfully, but these errors were encountered:
setInterval(callback, delay)
runs afterdelay
milliseconds. If thecallback
takes more time to run than thesedelay
milliseonds (because of slower API/database responses), the program will break.In context of this program, it only takes about 15 seconds for the async
callback
to run once. Thedelay
is set to 2 minutes to avoid said problem. This 2-minute delay givescallback
plenty of time to finish. But this is not efficient as the program is sitting idle rest of the time.A probable solution is to use the equivalent of a
sleep
function in Python details of which can be found here.The text was updated successfully, but these errors were encountered: