Minor tweaks for performance

This commit is contained in:
2022-12-06 20:40:38 -08:00
parent 8e0cf4a2a8
commit b2e55ee49e
2 changed files with 33 additions and 49 deletions

View File

@@ -18,11 +18,16 @@
(def bucket (:data-bucket env))
(defn s3->csv [url]
(->> (-> (s3/get-object {:bucket-name bucket
:key (str "bulk-import/" url)})
:input-stream
io/reader
csv/read-csv)))
(try
(->> (-> (s3/get-object {:bucket-name bucket
:key (str "bulk-import/" url)})
:input-stream
io/reader
csv/read-csv))
(catch Exception e
(log/error (str "Could not read the file " url ". Are you sure you uploaded it?"))
(log/error e)
(throw e))))
(defn register-invoice-import* [data]
(let [db (d/db conn)