From 47e615ebf4d079cb38b7aa6160a1d3ad89bbd347 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Sun, 10 Mar 2024 01:02:21 +0800 Subject: [PATCH] [feat] set httpx timeout to 10 --- app/hyap.hy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/hyap.hy b/app/hyap.hy index d25b221..c0af362 100644 --- a/app/hyap.hy +++ b/app/hyap.hy @@ -12,7 +12,7 @@ (with/a [client (.AsyncClient httpx)] (let [headers {"User-Agent" config.USER_AGENT "Accept" config.AP_CONTENT_TYPE}] - (await (.get client url :headers headers))))))) + (await (.get client url :headers headers :timeout 15))))))) (defn/a post [url payload] @@ -20,6 +20,6 @@ (let [headers {"User-Agent" config.USER_AGENT "Accept" config.AP_CONTENT_TYPE}] (setv resp - (await (.post client url :headers headers :json payload :auth auth))) + (await (.post client url :headers headers :json payload :auth auth :timeout 15))) (.raise_for_status resp) (return resp))))