From e82c1ab94e6cf6d81acb694542bfd5e02b6481b2 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Mon, 30 Sep 2024 00:42:10 +0800 Subject: [PATCH] [fix] compatible with hy 1.0.0 --- app/hyap.hy | 8 ++++---- app/hysql.hy | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/hyap.hy b/app/hyap.hy index 5ed614a..fe88e91 100644 --- a/app/hyap.hy +++ b/app/hyap.hy @@ -5,18 +5,18 @@ (import app.httpsig [auth]) -(defn/a fetch +(defn :async fetch [url] (.info logger url) (return (.json - (with/a [client (.AsyncClient httpx)] + (with [:async client (.AsyncClient httpx)] (let [headers {"User-Agent" config.USER_AGENT "Accept" config.AP_CONTENT_TYPE}] (await (.get client url :headers headers :timeout 15))))))) -(defn/a post +(defn :async post [url payload] - (with/a [client (.AsyncClient httpx)] + (with [:async client (.AsyncClient httpx)] (let [headers {"User-Agent" config.USER_AGENT "Content-Type" config.AP_CONTENT_TYPE}] (setv resp diff --git a/app/hysql.hy b/app/hysql.hy index 0f366ee..6a551db 100644 --- a/app/hysql.hy +++ b/app/hysql.hy @@ -6,14 +6,14 @@ (import pprint [pprint]) -(defn/a selete_object +(defn :async selete_object [db ap_type] (.all (await (.scalars db (.where (select models.InboxObject) (= models.InboxObject.ap_type ap_type)))))) -(defn/a get_index_status +(defn :async get_index_status [db] (.all (await (.scalars db