Avoid reflection on s3 storage backend.

This commit is contained in:
Andrey Antukh 2021-01-19 14:54:34 +01:00 committed by Alonso Torres
parent 34e5e5c513
commit ef25f8a721
2 changed files with 15 additions and 9 deletions

View file

@ -26,7 +26,10 @@
[cuerdas.core :as str]
[integrant.core :as ig]
[lambdaisland.uri :as u]
[promesa.exec :as px]))
[promesa.exec :as px])
(:import
java.io.InputStream))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Storage Module State
@ -159,8 +162,9 @@
;; if the source and destination backends are different, we just
;; need to obtain the streams and proceed full copy of the data
(with-open [input (-> (resolve-backend storage (:backend object))
(impl/get-object-data object))]
(with-open [^InputStream input
(-> (resolve-backend storage (:backend object))
(impl/get-object-data object))]
(-> (resolve-backend storage (:backend storage))
(impl/put-object object* (impl/content input (:size object))))))