diff --git a/README.md b/README.md index d4cc30a..cc7674e 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,11 @@ For asynchronous execution take a look at the [konserve example](https://github. Note that you do not need full S3 rights if you manage the bucket outside, i.e. create it before and delete it after usage form a privileged account. Connection -will otherwise create a bucket and it can be recursively deleted by -`delete-store.` You can activate [Amazon X-Ray](https://aws.amazon.com/xray/) by -setting `:x-ray?` to `true` in the S3 spec. +will otherwise create a bucket and all files created by konserve (with suffix +".ksv", ".ksv.new" or ".ksv.backup") will be deleted by `delete-store`, but the +bucket needs to be separately deleted by `delete-bucket`. You can activate +[Amazon X-Ray](https://aws.amazon.com/xray/) by setting `:x-ray?` to `true` in +the S3 spec. ## Authentication diff --git a/src/konserve_s3/core.clj b/src/konserve_s3/core.clj index 09a7562..2976174 100644 --- a/src/konserve_s3/core.clj +++ b/src/konserve_s3/core.clj @@ -225,10 +225,13 @@ (-delete-store [_ env] (async+sync (:sync? env) *default-sync-translation* (go-try- (when (bucket-exists? client bucket) - (info "AWS requires deletion of all keys first. This will be done sequentially now, but it will be faster to delete the bucket from the console.") - (doseq [key (list-objects client bucket)] + (info "This will delete all konserve files, but won't delete the bucket. You can use konserve-s3.core/delete-bucket if you intend to delete the bucket as well.") + (doseq [key (filter (fn [^String key] + (or (.endsWith key ".ksv") + (.endsWith key ".ksv.new") + (.endsWith key ".ksv.backup"))) + (list-objects client bucket))] (delete client bucket key)) - (delete-bucket client bucket) (.close client))))) (-keys [_ env] (async+sync (:sync? env) *default-sync-translation*