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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d315374401e1f267e514406a412303fdb76c538
4
- data.tar.gz: b1f51b8fd3529973df0b457a7edf55b0d38a22c6
3
+ metadata.gz: 79188f3e64d9875b9c7564649df2e02284dec36d
4
+ data.tar.gz: 903078a7f825ad182e4891bd8428c759b02ff014
5
5
  SHA512:
6
- metadata.gz: 7f9255eeb9734022304514aa6165b39c61a90cde7c63a24b06beb0bb0d63f2621fe9c98246f011695e575566a3aafbc7e1dcd93e3ffd45b0ce54ef8c164dc6ba
7
- data.tar.gz: 46fd4b7838da1c9fcd745e3f5df791eabcd731ec5dfa764a886cabee61d80ac13cab981cebd09ad38eb9449613869367cf4af0b95da6e561b925d9b8b633ad49
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.delete
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
- def delete!
27
- clear!
28
- delete
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.0
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-12 00:00:00.000000000 Z
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.0
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.0
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: