aws-sdk-resources 2.2.1 → 2.2.2
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 +18 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d7d5a81a230718f428c34cd8c21e99e0781d4a5
|
4
|
+
data.tar.gz: bae63ce259614c3a515aed264b21e7925cb67ba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588c6c64599214272f14e5879c6c2e0005475c60297ec300b5b4f64b96f1a00bb31b130c288d50781e643233e6df2ca7d96141f7755510d7d88684a645ebc0e1
|
7
|
+
data.tar.gz: 790d7098714a948d791226a1fd4fd16ff3ccd8c8dbdae18ebeafe02aee300fccd532f2ff1bee57f9678ec8d9cb0167cc196456ed358387b41d67f4bafe71a4ef
|
@@ -22,28 +22,33 @@ module Aws
|
|
22
22
|
#
|
23
23
|
# bucket.delete!
|
24
24
|
#
|
25
|
-
# @option options [
|
26
|
-
#
|
25
|
+
# @option options [Integer] :max_attempts (3) Maximum number of times to
|
26
|
+
# attempt to delete the empty bucket before raising
|
27
|
+
# `Aws::S3::Errors::BucketNotEmpty`.
|
28
|
+
#
|
29
|
+
# @option options [Float] :initial_wait (1.3) Seconds to wait before
|
30
|
+
# retrying the call to delete the bucket, exponentially increased for
|
31
|
+
# each attempt.
|
27
32
|
#
|
28
33
|
# @return [void]
|
29
|
-
DELETE_BANG_DEFAULTS = { initial_wait: 1.3, max_attempts: 3 }
|
30
|
-
|
31
34
|
def delete! options = { }
|
32
|
-
options =
|
35
|
+
options = {
|
36
|
+
initial_wait: 1.3,
|
37
|
+
max_attempts: 3,
|
38
|
+
}.merge(options)
|
33
39
|
|
34
40
|
attempts = 0
|
35
|
-
|
36
41
|
begin
|
37
42
|
clear!
|
38
43
|
delete
|
39
|
-
rescue Errors::BucketNotEmpty =>
|
44
|
+
rescue Errors::BucketNotEmpty => error
|
40
45
|
attempts += 1
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
if attempts >= options[:max_attempts]
|
47
|
+
raise
|
48
|
+
else
|
49
|
+
Kernel.sleep(options[:initial_wait] ** attempts)
|
50
|
+
retry
|
51
|
+
end
|
47
52
|
end
|
48
53
|
end
|
49
54
|
|
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.2
|
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-24 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.2
|
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.2
|
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:
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.2.2
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: AWS SDK for Ruby - Resources
|