Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Commit f399eb8

Browse files
committed
perform old version deletions asynchronously
1 parent f042650 commit f399eb8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/io/pithos/operations.clj

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,17 @@
284284
(let [parts (desc/part-descriptors system bucket object upload-id)
285285
od (stream/stream-copy-parts parts od push-str)]
286286
(desc/save! od)
287-
(when previous
288-
(blob/delete! (desc/blobstore od) od previous))
289-
(doseq [part parts]
290-
(meta/abort-multipart-upload! (bucket/metastore part)
291-
bucket
292-
object
293-
upload-id)
294-
(blob/delete! (desc/blobstore part) part (desc/version part)))
287+
288+
(future
289+
;; This can be time consuming
290+
(doseq [part parts]
291+
(meta/abort-multipart-upload! (bucket/metastore part)
292+
bucket
293+
object
294+
upload-id)
295+
(blob/delete! (desc/blobstore part) part (desc/version part)))
296+
(when previous
297+
(blob/delete! (desc/blobstore od) od previous)))
295298

296299
(debug "all streams now flushed")
297300
(push-str (xml/complete-multipart-upload bucket object

0 commit comments

Comments
 (0)