eco-helpers 3.0.15 → 3.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/eco-helpers.gemspec +1 -1
- data/lib/eco/api/microcases/people_refresh.rb +1 -1
- data/lib/eco/api/session/batch.rb +17 -9
- data/lib/eco/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baeb42abbb1d31497328afd4c813dec4acfebb598546ad55a4f1265a45dc89b5
|
4
|
+
data.tar.gz: 7d4c88626946b84e1ea22f3b27eb7570a9daa6d2962036e6fbf667b000dd5996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8af8fdbccacb57655756a01f0c30ff1d38c58e232f77fedc5aeb058cb7260ed1863834af1995d7268d355e09c00fedc671b4417f1f14d76c25c9609a038b47d3
|
7
|
+
data.tar.gz: c4daf6291086d8b15f5eb1606291e8161e0e0326b4f5ed8e917e95d09b9c1de7ff2665e44ec3ed35986d0cd07ec232dfe40822d0d32bbd12020f7290a9ce1405
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,26 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [3.0.17] - 2024-10-xx
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
## [3.0.16] - 2024-10-15
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
|
19
|
+
- `Eco::API::Session::Batch#launch_batch`
|
20
|
+
- Made benchmarking consistent on last batch
|
21
|
+
- upgrade `ecoportal-api` core gem
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
5
25
|
## [3.0.15] - 2024-10-01
|
6
26
|
|
7
27
|
### Added
|
data/eco-helpers.gemspec
CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
|
|
40
40
|
spec.add_dependency 'bcrypt_pbkdf', '~> 1.0'
|
41
41
|
spec.add_dependency 'docx', '>= 0.8.0', '< 0.9'
|
42
42
|
spec.add_dependency 'dotenv', '~> 3'
|
43
|
-
spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.
|
43
|
+
spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.4'
|
44
44
|
spec.add_dependency 'ecoportal-api-graphql', '~> 0.4', '>= 0.4.2'
|
45
45
|
spec.add_dependency 'ecoportal-api-v2', '~> 2.0', '>= 2.0.10'
|
46
46
|
spec.add_dependency 'ed25519', '~> 1.2'
|
@@ -25,7 +25,7 @@ module Eco
|
|
25
25
|
|
26
26
|
created = people.length - ini
|
27
27
|
msg = "Going to refresh #{people.length} people with server data"
|
28
|
-
msg
|
28
|
+
msg << " (including #{created} that were created)" if created.positive?
|
29
29
|
log(:info) { msg }
|
30
30
|
|
31
31
|
start = Time.now
|
@@ -164,7 +164,7 @@ module Eco
|
|
164
164
|
ASSETS.cli.options
|
165
165
|
end
|
166
166
|
|
167
|
-
def launch_batch( # rubocop:disable Metrics/AbcSize
|
167
|
+
def launch_batch( # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
168
168
|
data,
|
169
169
|
method:,
|
170
170
|
status: nil,
|
@@ -185,17 +185,18 @@ module Eco
|
|
185
185
|
)
|
186
186
|
|
187
187
|
status.tap do
|
188
|
-
start_time = Time.now
|
189
|
-
start_slice = Time.now
|
190
|
-
|
191
188
|
pending_for_server_error = data.to_a[0..]
|
189
|
+
|
190
|
+
start_time = Time.now
|
191
|
+
|
192
192
|
data.each_slice(per_page) do |slice|
|
193
|
-
msg = "starting batch '#{method}' iteration #{iteration}/#{iterations},"
|
194
|
-
msg << "
|
195
|
-
msg << "
|
193
|
+
msg = "starting batch '#{method}' iteration #{iteration}/#{iterations}, "
|
194
|
+
msg << "with #{slice.length} entries of #{data.length} -- #{done} done"
|
195
|
+
msg << (" " * 20)
|
196
196
|
log(:info) { msg } unless silent
|
197
197
|
|
198
198
|
start_slice = Time.now
|
199
|
+
|
199
200
|
offer_retry_on(Ecoportal::API::Errors::TimeOut) do
|
200
201
|
people_api.batch(job_mode: job_mode?(options)) do |batch|
|
201
202
|
slice.each do |person|
|
@@ -211,8 +212,15 @@ module Eco
|
|
211
212
|
end # end batch
|
212
213
|
end
|
213
214
|
|
215
|
+
done += slice.length
|
216
|
+
|
217
|
+
msg = " ... iteration #{iteration}/#{iterations} done "
|
218
|
+
msg << "in #{str_stats(start_slice, slice.length)} "
|
219
|
+
msg << "(average: #{str_stats(start_time, done)})"
|
220
|
+
msg << (" " * 20)
|
221
|
+
log(:info) { msg } unless silent
|
222
|
+
|
214
223
|
iteration += 1
|
215
|
-
done += slice.length
|
216
224
|
end # next slice
|
217
225
|
|
218
226
|
# temporary working around (due to back-end problems with batch/jobs)
|
@@ -261,7 +269,7 @@ module Eco
|
|
261
269
|
|
262
270
|
def str_stats(start, count)
|
263
271
|
now = Time.now
|
264
|
-
secs = (now - start).round(
|
272
|
+
secs = (now - start).round(2)
|
265
273
|
if secs > 0.0
|
266
274
|
per_sec = (count.to_f / secs).round(2)
|
267
275
|
"#{secs}s -> #{per_sec} people/s"
|
data/lib/eco/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eco-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -229,7 +229,7 @@ dependencies:
|
|
229
229
|
version: '0.10'
|
230
230
|
- - ">="
|
231
231
|
- !ruby/object:Gem::Version
|
232
|
-
version: 0.10.
|
232
|
+
version: 0.10.4
|
233
233
|
type: :runtime
|
234
234
|
prerelease: false
|
235
235
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -239,7 +239,7 @@ dependencies:
|
|
239
239
|
version: '0.10'
|
240
240
|
- - ">="
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
version: 0.10.
|
242
|
+
version: 0.10.4
|
243
243
|
- !ruby/object:Gem::Dependency
|
244
244
|
name: ecoportal-api-graphql
|
245
245
|
requirement: !ruby/object:Gem::Requirement
|