Open gadenbuie opened 1 year ago
the wait time can be quite long, up to 100 seconds by default
just to clarify this one point, that is specific to the Sheets API, which has very specific per user quotas
It looks like those have changed since I last set up the special case for Sheets retries, so maybe I don't need the 100 seconds thing any more:
When working with gargle via a package like googlesheets, failed requests are automatically retried. This is excellent and it means requests almost always make it through.
The downside is that the retries understandably backoff rather aggressively, so the wait time can be quite long, up to 100 seconds by default. In a Shiny app, this can be an eternity of waiting for the end user, and it'd be helpful for the app author to be able to give some feedback on the progress of the request.
The feature request is for gargle to offer some window of opportunity to know that a retry has happened and to run code before the next retry occurs.
Just brainstorming, two potential ways to do this could be:
gargle::request_retry()
could execute a callback function, found via an R option, before callingSys.sleep()
.gargle::request_retry()
could take inspiration fromrlang::check_installed()
and signal a known condition with restarts. This would give (admittedly expert) users a chance to run code before returning control torequest_retry()
.