aws-sdk-resources 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-resources/services/s3/bucket.rb +23 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79188f3e64d9875b9c7564649df2e02284dec36d
|
4
|
+
data.tar.gz: 903078a7f825ad182e4891bd8428c759b02ff014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afffa7e59320166a4e5b115ac1305e0a5808389fafa672e73f7ac76ac456b20450eef00fd2a256dc65c408d7406aa982e7bc7225298c44fd7309dff8cfecf7bd
|
7
|
+
data.tar.gz: 6b9cbdf8ebe2ff0c4e01a5fe405c2ee0f26d2c641f80da9882a9afa82822852a27e79649b563abac3fcd1235d06327c5c958c8169467dc02597216ef8b2d4073
|
@@ -12,7 +12,7 @@ module Aws
|
|
12
12
|
#
|
13
13
|
# @return [void]
|
14
14
|
def clear!
|
15
|
-
object_versions.
|
15
|
+
object_versions.batch_delete!
|
16
16
|
end
|
17
17
|
|
18
18
|
# Deletes all objects and versioned objects from this bucket and
|
@@ -22,10 +22,29 @@ module Aws
|
|
22
22
|
#
|
23
23
|
# bucket.delete!
|
24
24
|
#
|
25
|
+
# @option options [Float] :initial_wait (1.3) Initial wait time. Exponentially increased for each attempt.
|
26
|
+
# [Fixnum] :max_attempts (3) Maximum number of attempts to make before raising Errors::BucketNotEmpty.
|
27
|
+
#
|
25
28
|
# @return [void]
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
+
DELETE_BANG_DEFAULTS = { initial_wait: 1.3, max_attempts: 3 }
|
30
|
+
|
31
|
+
def delete! options = { }
|
32
|
+
options = DELETE_BANG_DEFAULTS.merge options
|
33
|
+
|
34
|
+
attempts = 0
|
35
|
+
|
36
|
+
begin
|
37
|
+
clear!
|
38
|
+
delete
|
39
|
+
rescue Errors::BucketNotEmpty => e
|
40
|
+
attempts += 1
|
41
|
+
|
42
|
+
raise e if attempts >= options[:max_attempts]
|
43
|
+
|
44
|
+
Kernel.sleep options[:initial_wait] ** attempts
|
45
|
+
|
46
|
+
retry
|
47
|
+
end
|
29
48
|
end
|
30
49
|
|
31
50
|
# Returns a public URL for this bucket.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.2.
|
19
|
+
version: 2.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.2.
|
26
|
+
version: 2.2.1
|
27
27
|
description: Provides resource oriented interfaces and other higher-level abstractions
|
28
28
|
for many AWS services. This gem is part of the official AWS SDK for Ruby.
|
29
29
|
email:
|