Makes logging unified
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
[auto-ap.jobs.core :refer [execute]]
|
||||
[auto-ap.time :as time]
|
||||
[clj-time.coerce :as coerce]
|
||||
[clojure.tools.logging :as log]
|
||||
[auto-ap.logging :as alog]
|
||||
[datomic.api :as dc]))
|
||||
|
||||
(defn close-auto-invoices []
|
||||
@@ -15,15 +15,16 @@
|
||||
'[?e :invoice/status :invoice-status/unpaid]
|
||||
'[(<= ?d ?today)]]}
|
||||
(dc/db conn) (coerce/to-date (time/local-now)))]
|
||||
(log/info "Closing " (count invoices-to-close) "scheduled invoices")
|
||||
(alog/info ::closing :count (count invoices-to-close))
|
||||
@(dc/transact conn (some->> invoices-to-close
|
||||
seq
|
||||
seq
|
||||
|
||||
(mapv (fn [[i]] {:db/id i
|
||||
:invoice/outstanding-balance 0.0
|
||||
:invoice/status :invoice-status/paid}))
|
||||
))
|
||||
(log/info "Closed " (count invoices-to-close) "scheduled invoices")))
|
||||
(mapv (fn [[i]] {:db/id i
|
||||
:invoice/outstanding-balance 0.0
|
||||
:invoice/status :invoice-status/paid}))
|
||||
))
|
||||
|
||||
(alog/info ::closed :count (count invoices-to-close))))
|
||||
|
||||
|
||||
(defn -main [& _]
|
||||
|
||||
Reference in New Issue
Block a user