relaton 1.9.4 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton/db.rb +13 -6
- data/lib/relaton/version.rb +1 -1
- data/spec/vcr_cassetes/iana_service_names_port_numbers.yml +35 -12
- data/spec/vcr_cassetes/iso_19115_1.yml +16 -16
- 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: d130b4485dbbf753e79494a4d586acf8fd85df120d4e2f1f35aa5c7380e05811
|
4
|
+
data.tar.gz: 1872fc4d88f29de709f81dfca39132d1c7fb244b9069661d8c7c4bca70a80977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1209e92a74b33acc54fcc1f391ec4beb1833cb2886375188f16ff8feb6c7c12c6f2e56978b3a77b442599fafa5bfbc4b4edfec6305e422afdb97cbc3e07190a0
|
7
|
+
data.tar.gz: f5a8c37e80afa5b80d7779735d54f685e9ba85a2bea6acd2ad3a4608b4e74d75c76248b6989af7df05df1f50f975b0ab85397355c90c2c2f50bc00159fc7d5fe
|
data/lib/relaton/db.rb
CHANGED
@@ -17,6 +17,7 @@ module Relaton
|
|
17
17
|
@static_db = open_cache_biblio File.expand_path("../relaton/static_cache",
|
18
18
|
__dir__)
|
19
19
|
@queues = {}
|
20
|
+
@semaphore = Mutex.new
|
20
21
|
end
|
21
22
|
|
22
23
|
# Move global or local caches to anothe dirs
|
@@ -375,14 +376,20 @@ module Relaton
|
|
375
376
|
return bib_retval(bibentry, stdclass)
|
376
377
|
end
|
377
378
|
|
378
|
-
|
379
|
+
@semaphore.synchronize do
|
380
|
+
db.delete(id) unless db.valid_entry?(id, year)
|
381
|
+
end
|
379
382
|
if altdb
|
380
383
|
return bib_retval(altdb[id], stdclass) if opts[:fetch_db]
|
381
384
|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
385
|
+
@semaphore.synchronize do
|
386
|
+
db.clone_entry id, altdb if altdb.valid_entry? id, year
|
387
|
+
end
|
388
|
+
entry = new_bib_entry(searchcode, year, opts, stdclass, db: db, id: id) unless db[id]
|
389
|
+
@semaphore.synchronize do
|
390
|
+
db[id] ||= entry
|
391
|
+
altdb.clone_entry(id, db) if !altdb.valid_entry?(id, year)
|
392
|
+
end
|
386
393
|
else
|
387
394
|
return bib_retval(db[id], stdclass) if opts[:fetch_db]
|
388
395
|
|
@@ -413,7 +420,7 @@ module Relaton
|
|
413
420
|
if args[:db] && args[:id] &&
|
414
421
|
bib_id && args[:id] !~ %r{#{Regexp.quote("(#{bib_id})")}}
|
415
422
|
bid = std_id(bib.docidentifier.first.id, nil, {}, stdclass).first
|
416
|
-
args[:db][bid] ||= bib_entry bib
|
423
|
+
@semaphore.synchronize { args[:db][bid] ||= bib_entry bib }
|
417
424
|
"redirection #{bid}"
|
418
425
|
else bib_entry bib
|
419
426
|
end
|
data/lib/relaton/version.rb
CHANGED