[fix] compatible with hy 1.0.0
All checks were successful
/ run-pytest (push) Successful in 47s

This commit is contained in:
SouthFox 2024-09-30 00:42:10 +08:00
parent 92a8ecffd6
commit e82c1ab94e
2 changed files with 6 additions and 6 deletions

View file

@ -5,18 +5,18 @@
(import app.httpsig [auth]) (import app.httpsig [auth])
(defn/a fetch (defn :async fetch
[url] [url]
(.info logger url) (.info logger url)
(return (.json (return (.json
(with/a [client (.AsyncClient httpx)] (with [:async client (.AsyncClient httpx)]
(let [headers {"User-Agent" config.USER_AGENT (let [headers {"User-Agent" config.USER_AGENT
"Accept" config.AP_CONTENT_TYPE}] "Accept" config.AP_CONTENT_TYPE}]
(await (.get client url :headers headers :timeout 15))))))) (await (.get client url :headers headers :timeout 15)))))))
(defn/a post (defn :async post
[url payload] [url payload]
(with/a [client (.AsyncClient httpx)] (with [:async client (.AsyncClient httpx)]
(let [headers {"User-Agent" config.USER_AGENT (let [headers {"User-Agent" config.USER_AGENT
"Content-Type" config.AP_CONTENT_TYPE}] "Content-Type" config.AP_CONTENT_TYPE}]
(setv resp (setv resp

View file

@ -6,14 +6,14 @@
(import pprint [pprint]) (import pprint [pprint])
(defn/a selete_object (defn :async selete_object
[db ap_type] [db ap_type]
(.all (await (.scalars db (.all (await (.scalars db
(.where (select models.InboxObject) (.where (select models.InboxObject)
(= models.InboxObject.ap_type ap_type)))))) (= models.InboxObject.ap_type ap_type))))))
(defn/a get_index_status (defn :async get_index_status
[db] [db]
(.all (await (.all (await
(.scalars db (.scalars db