roadworker 0.5.14 → 0.5.15

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
  SHA256:
3
- metadata.gz: 33bb9bbc3a38db10787d008687b4e2b9cb38a5114140fe3a95b78b19fe269900
4
- data.tar.gz: 757ac4a3621ff48effbde3be06debef5ce1f1206546ecc0f115d75f7148e0dc5
3
+ metadata.gz: 163707e7a36317de25bda9f1c0af701729fbf6cbb67bcabf51f7fed86e5f97a9
4
+ data.tar.gz: 044bbcd3a3c89be69d86be7b16f183588865770122001023ad11576409408267
5
5
  SHA512:
6
- metadata.gz: 4e874e443ee768389d3cc0eacc164d270d4169b55d0c8169500956b895085f7bd5f10c6e1571ff4d786981b3d4adf569462964ba3e8dafc15ed2f6029fc92f3c
7
- data.tar.gz: 148572096e1e293beb9b1ddc0687ef5ec6a97d52b0a72de6942b7d049425d1a57b56f1fbcb2955e9e8c89a00903e1595075a8dfee5d456b96f54469874ba3092
6
+ metadata.gz: 7049cb4fb2254a360eafe3f54a53d923faa1d042e7533aab9c54d61a06899d7bc55805263ae672bf01d17c880af32ebe8a5afe2c7e2fa1ec2efd653942473696
7
+ data.tar.gz: c323c0eef4acebe24f9dc04e261e4434a0c814913d678ba563aa93a47a0d0c5f741bca039767314ef023cb140abeae9e623e0c47ec5356aec0736d828849b797
@@ -85,10 +85,10 @@ module Roadworker
85
85
  total_ops = 0
86
86
  ops.slice_before do |op|
87
87
  total_value_size += op.value_size
88
- total_ops += 1
88
+ total_ops += op.op_size
89
89
  if total_value_size > 32000 || total_ops > 1000
90
90
  total_value_size = op.value_size
91
- total_ops = 1
91
+ total_ops = op.op_size
92
92
  true
93
93
  else
94
94
  false
@@ -150,6 +150,8 @@ module Roadworker
150
150
  end
151
151
 
152
152
  # Count total length of RR "Value" included in changes
153
+ # https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-requests-changeresourcerecordsets
154
+ #
153
155
  # See also: Batch#slice_operations
154
156
  # @return [Integer]
155
157
  def value_size
@@ -163,6 +165,17 @@ module Roadworker
163
165
  end.sum || 0
164
166
  end
165
167
 
168
+ # Count of operational size
169
+ # https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-requests-changeresourcerecordsets
170
+ #
171
+ # See also: Batch#slice_operations
172
+ # @return [Integer]
173
+ def op_size
174
+ changes.map do |change|
175
+ change[:action] == 'UPSERT' ? 2 : 1
176
+ end.sum || 0
177
+ end
178
+
166
179
  # @return [Array<Hash>]
167
180
  def changes
168
181
  raise NotImplementedError
@@ -1,3 +1,3 @@
1
1
  module Roadworker
2
- VERSION = "0.5.14"
2
+ VERSION = "0.5.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.14
4
+ version: 0.5.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2021-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-route53
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  - !ruby/object:Gem::Version
239
239
  version: '0'
240
240
  requirements: []
241
- rubygems_version: 3.1.2
241
+ rubygems_version: 3.1.4
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Roadworker is a tool to manage Route53.