aboutsummaryrefslogtreecommitdiff
path: root/sx-request.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-07-02 16:17:51 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-07-02 16:17:51 +0100
commit590c393a55c0e565e1eded21a5fd900e8ffcc580 (patch)
tree4533178f404f1308ccd300debf3d966d220a4dd4 /sx-request.el
parent4ebe7d34773f6bc4fda24ac40996757fb6ecd881 (diff)
Some fixes for the bot and the backoff.
Diffstat (limited to 'sx-request.el')
-rw-r--r--sx-request.el7
1 files changed, 3 insertions, 4 deletions
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)