Improve internal naming of setup/props

This reverts commit a6f70c77cb.
This commit is contained in:
Andrey Antukh 2024-03-14 10:29:21 +01:00
parent 75d0648065
commit 91118bec70
19 changed files with 77 additions and 63 deletions

View file

@ -24,6 +24,7 @@
[app.main :as-alias main]
[app.rpc :as-alias rpc]
[app.rpc.retry :as rtry]
[app.setup :as-alias setup]
[app.tokens :as tokens]
[app.util.services :as-alias sv]
[app.util.time :as dt]
@ -261,7 +262,7 @@
(s/def ::tasks/uri ::us/string)
(defmethod ig/pre-init-spec ::tasks/archive-task [_]
(s/keys :req [::db/pool ::main/props ::http.client/client]))
(s/keys :req [::db/pool ::setup/props ::http.client/client]))
(defmethod ig/init-key ::tasks/archive
[_ cfg]
@ -287,7 +288,7 @@
(px/sleep 100)
(recur (+ total ^long n)))
(when (pos? total)
(l/debug :hint "events archived" :total total)))))))))
(l/dbg :hint "events archived" :total total)))))))))
(def ^:private sql:retrieve-batch-of-audit-log
"select *
@ -322,7 +323,7 @@
:context]))
(send [events]
(let [token (tokens/generate (::main/props cfg)
(let [token (tokens/generate (::setup/props cfg)
{:iss "authentication"
:iat (dt/now)
:uid uuid/zero})
@ -331,11 +332,11 @@
"origin" (cf/get :public-uri)
"cookie" (u/map->query-string {:auth-token token})}
params {:uri uri
:timeout 6000
:timeout 12000
:method :post
:headers headers
:body body}
resp (http.client/req! cfg params {:sync? true})]
resp (http.client/req! cfg params)]
(if (= (:status resp) 204)
true
(do
@ -355,7 +356,7 @@
(map row->event))
events (into [] xform rows)]
(when-not (empty? events)
(l/trace :hint "archive events chunk" :uri uri :events (count events))
(l/trc :hint "archive events chunk" :uri uri :events (count events))
(when (send events)
(mark-as-archived conn rows)
(count events)))))))