mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-09-25 21:10:02 +00:00
43ad3d0c15
The existing polling code had a few problems: * It started the timer for a new request when the first request was sent, rather than when a response was received. * It increased the delay regardless of whether the response was a success or a failure. This commit changes it to a more standard exponential backoff system, where it starts with a 5 minute ± 30 second delay, and uses that same delay until it hits an error, at which point the delay is increased by 10%. Once it receives a successful response again, the delay is reset to the default. I suspect this should be nicer on the server, since it avoids the initial sending of many requests. After about half an hour of leaving the page open, the request rate for this new code will be higher than that of the old code, so it's possible that this may cause problems, but I think that a five-minute request frequency should be pretty reasonable. |
||
---|---|---|
.. | ||
vendor | ||
autocomplete.js | ||
bookwyrm.js | ||
forms.js | ||
guided_tour.js | ||
localstorage.js | ||
status_cache.js | ||
tabs.js |