relaton 1.9.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/README.adoc +2 -2
- data/lib/relaton/db.rb +4 -4
- data/lib/relaton/version.rb +1 -1
- data/spec/relaton/db_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3599c52bacdd454603dc095055338b4a89b8264ee9391fa2a2b25f1724a46e2
|
4
|
+
data.tar.gz: aa64435911173af46c12a522b05d063c4cfa0644f1919c96ec3879f9b8f9af39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74fc610b35697515cf2f925349ff9ad076c50a3ec8e0fa08a9cbfa3fc82217c32b2f5e2869af604a58e12f70898de41addade73971a6fae9085b56eb7b3b5ff0
|
7
|
+
data.tar.gz: 8cda3116f9e84eb3f549dc1a4c5a74fb6957d4834d0cf140f587434f2b9ff84e7cae93946147b7151fa6cf1739f13aba1639f92c2f73fce552999e3a7dfe35fd
|
data/docs/README.adoc
CHANGED
@@ -187,8 +187,8 @@ refs = ["ISO 19011", "ISO 19115"]
|
|
187
187
|
|
188
188
|
# fetch documents
|
189
189
|
refs.each do |ref|
|
190
|
-
db.fetch_async(ref
|
191
|
-
results << [doc,
|
190
|
+
db.fetch_async(ref) do |doc|
|
191
|
+
results << [doc, ref]
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
data/lib/relaton/db.rb
CHANGED
@@ -99,20 +99,20 @@ module Relaton
|
|
99
99
|
end
|
100
100
|
|
101
101
|
# Fetch asynchronously
|
102
|
-
def fetch_async(code, year = nil, opts = {},
|
102
|
+
def fetch_async(code, year = nil, opts = {}, &block) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
103
103
|
stdclass = standard_class code
|
104
104
|
if stdclass
|
105
105
|
unless @queues[stdclass]
|
106
106
|
processor = @registry.processors[stdclass]
|
107
107
|
wp = WorkersPool.new(processor.threads) do |args|
|
108
|
-
|
108
|
+
args[3].call fetch(*args[0..2])
|
109
109
|
rescue RelatonBib::RequestError => e
|
110
|
-
|
110
|
+
args[3].call e
|
111
111
|
end
|
112
112
|
@queues[stdclass] = { queue: Queue.new, workers_pool: wp }
|
113
113
|
Thread.new { process_queue @queues[stdclass] }
|
114
114
|
end
|
115
|
-
@queues[stdclass][:queue] << [code, year, opts,
|
115
|
+
@queues[stdclass][:queue] << [code, year, opts, block]
|
116
116
|
else yield nil
|
117
117
|
end
|
118
118
|
end
|
data/lib/relaton/version.rb
CHANGED
data/spec/relaton/db_spec.rb
CHANGED
@@ -163,8 +163,8 @@ RSpec.describe Relaton::Db do
|
|
163
163
|
results = []
|
164
164
|
VCR.use_cassette "async_fetch", match_requests_on: %i[method uri body] do
|
165
165
|
refs.each do |ref|
|
166
|
-
db.fetch_async(ref
|
167
|
-
queue << [r,
|
166
|
+
db.fetch_async(ref) do |r|
|
167
|
+
queue << [r, ref]
|
168
168
|
end
|
169
169
|
end
|
170
170
|
Timeout.timeout(60) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton-bipm
|