(cloud) experimental approach to ensure the ledgers do not get out of sync

This commit is contained in:
2023-04-02 07:45:12 -07:00
parent baa1c2e001
commit 68e809d8fb
10 changed files with 301 additions and 134 deletions

View File

@@ -2,9 +2,8 @@
(:gen-class)
(:require
[amazonica.aws.s3 :as s3]
[auto-ap.datomic :refer [conn pull-attr]]
[auto-ap.datomic :refer [audit-transact conn pull-attr]]
[auto-ap.jobs.core :refer [execute]]
[auto-ap.ledger :refer [transact-with-ledger]]
[auto-ap.time :as atime]
[auto-ap.utils :refer [dollars=]]
[clj-time.coerce :as coerce]
@@ -14,7 +13,8 @@
[clojure.tools.logging :as log]
[config.core :refer [env]]
[datomic.client.api :as dc])
(:import [java.util UUID]))
(:import
(java.util UUID)))
(def bucket (:data-bucket env))
@@ -141,8 +141,8 @@
(log/info "contains " (count data) " rows")
(doseq [n (partition-all 50 (register-invoice-import* data))]
(log/info "transacting" n)
(transact-with-ledger n {:user/name "register-invoice-import"
:user/role "admin"}))))
(audit-transact n {:user/name "register-invoice-import"
:user/role "admin"}))))
(defn -main [& _]
(execute "register-invoice-import" #(register-invoice-import (:args env))))