Tries to not put everything into memory first

This commit is contained in:
2023-03-28 14:05:14 -07:00
parent 9e96ce4944
commit d6f0468725

View File

@@ -498,11 +498,18 @@
(s/buffer 20)
(s/realize-each)))
)
(mu/log ::copying)
(s3/put-object :bucket-name (:data-bucket env)
:key (str backup-id "/" entity ".ednl")
:input-stream (io/make-input-stream (io/file "/tmp/tmp-ednl") {}))
(mu/log ::copied)))))))
(try
(mu/log ::copying)
(let [f (io/file "/tmp/tmp-ednl")]
(s3/put-object :bucket-name (:data-bucket env)
:key (str backup-id "/" entity ".ednl")
:input-stream (io/make-input-stream f {})
:metadata {:content-length (.length f)}))
(mu/log ::copied)
(catch Exception e
(mu/log ::upload-error
:exception e)
(throw e)))))))))
(defn -main [& _]
(try