summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-10-17 03:20:24 +0300
committerGravatar Uko Kokņevičs2025-10-17 03:20:24 +0300
commit9f46d74106dc83deae28e894699cbf4a4d2ba184 (patch)
treecac72fea634c85febb558503f5fd63f04e28b444
parentMove bot/method-macros to tg/method-macros (diff)
downloadukkoclot-9f46d74106dc83deae28e894699cbf4a4d2ba184.tar.gz
ukkoclot-9f46d74106dc83deae28e894699cbf4a4d2ba184.tar.xz
ukkoclot-9f46d74106dc83deae28e894699cbf4a4d2ba184.zip
Try to avoid hanging when making requests
-rw-r--r--src/transport.lisp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/transport.lisp b/src/transport.lisp
index 39198dd..941341a 100644
--- a/src/transport.lisp
+++ b/src/transport.lisp
@@ -14,8 +14,11 @@
14(in-package :ukkoclot/transport) 14(in-package :ukkoclot/transport)
15 15
16(defun req (uri method content) 16(defun req (uri method content)
17 (let ((retrier (dex:retry-request 5 :interval 1))) 17 (let ((retrier (dex:retry-request 5 :interval 1))
18 (handler-case (dex:request uri :method method :content content) 18 ;; This is needed to avoid hangs,
19 ;; see https://github.com/fukamachi/dexador/issues/91#issuecomment-1093472364
20 (cl+ssl:*default-unwrap-stream-p* nil))
21 (handler-case (dex:request uri :method method :content content :read-timeout 60 :connect-timeout 60)
19 ;; We deal with too many requests manually 22 ;; We deal with too many requests manually
20 (dex:http-request-too-many-requests (e) (dex:ignore-and-continue e)) 23 (dex:http-request-too-many-requests (e) (dex:ignore-and-continue e))
21 (dex:http-request-failed (e) (funcall retrier e)) 24 (dex:http-request-failed (e) (funcall retrier e))