From 590c393a55c0e565e1eded21a5fd900e8ffcc580 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 2 Jul 2015 16:17:51 +0100 Subject: Some fixes for the bot and the backoff. --- sx-request.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sx-request.el') diff --git a/sx-request.el b/sx-request.el index 7a7bbf4..10bec4a 100644 --- a/sx-request.el +++ b/sx-request.el @@ -92,8 +92,7 @@ number of requests left every time it finishes a call." :group 'sx :type 'integer) -(defvar sx-request-all-items-delay - 1 +(defvar sx-request-all-items-delay 0 "Delay in seconds with each `sx-request-all-items' iteration. It is good to use a reasonable delay to avoid rate-limiting.") @@ -110,9 +109,9 @@ It is good to use a reasonable delay to avoid rate-limiting.") ;; we've likely just looped around the "least significant" ;; bits of `current-time'. (setq sx--backoff-time time) - (message "Backoff detected, waiting %s seconds" (< time sx--backoff-time)) (when (< time sx--backoff-time) - (sleep-for (+ 2 (- sx--backoff-time time)))))))) + (message "Backoff detected, waiting %s seconds" (- sx--backoff-time time)) + (sleep-for (+ 0.3 (- sx--backoff-time time)))))))) (defun sx-request-all-items (method &optional args request-method stop-when) -- cgit v1.2.3