diff --git a/R/utils.R b/R/utils.R index 7ec1838..9a68ba2 100644 --- a/R/utils.R +++ b/R/utils.R @@ -140,9 +140,9 @@ sayif <- function(verbose, ...) { } # inspired by rtweet -wait_until <- function(until,verbose = TRUE){ +wait_until <- function(until, from = Sys.time(), verbose = TRUE){ until <- as.numeric(until) - seconds <- ceiling(until - unclass(Sys.time())) + seconds <- ceiling(until - unclass(from)) if(seconds>0){ sayif(verbose,"Rate limit exceeded, waiting for ",seconds," seconds") Sys.sleep(seconds)