Updates for events.

This commit is contained in:
2022-01-06 07:24:05 -08:00
parent 1439f291b4
commit 6cb8731b7f
6 changed files with 111 additions and 53 deletions

View File

@@ -18,7 +18,8 @@
[unilog.context :as lc]
[clj-time.core :as time]
[mount.core :as mount]
[yang.scheduler :as scheduler]))
[yang.scheduler :as scheduler]
[com.unbounce.dogstatsd.core :as statsd]))
(def bucket-name (:data-bucket env))
@@ -124,6 +125,11 @@
:prefix "sysco/pending"})
:object-summaries
(map :key))]
(statsd/event {:title "Sysco import started"
:text (format "Found %d sysco invoice to import: %s" (count keys) (pr-str keys))
:priority :low}
nil)
(log/infof "Found %d sysco invoice to import: %s" (count keys) (pr-str keys))
(let [result @(d/transact conn (mapv (fn [k]
@@ -134,7 +140,10 @@
keys))]
(log/infof "Imported %d invoices" (/ (count (:tempids result)) 2)))
(doseq [k keys]
(mark-key k)))))
(mark-key k))
(statsd/event {:title "Sysco import ended"
:text "Sysco completed"
:priority :low} nil))))
(mount/defstate sysco-invoice-importer