cul_scv_hydra 0.22.9.2 → 0.22.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cul_hydra/indexer.rb +19 -1
- data/lib/cul_hydra/version.rb +1 -1
- data/lib/cul_hydra/version.rb~ +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74eb59743de94c1af1a616faf50cca6ec1db46a3
|
4
|
+
data.tar.gz: cc5710e6808263fd1b746c38c654a3c9b7d3384e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db5c72d0990e346aca07e8ac9a01005910b011b8cd381b5b685a6f7a159d6ea34dd3e09c9f41088520cb64e846569289aa7ec9df5436d6aad4a47feac40b0234
|
7
|
+
data.tar.gz: 5e3e4a18eae4648d84605e8599c10fad3384d66bd98dae27642713ccf4f1befa93752515a6ba33000007fcf52f28e98d15c69066e92beed4eb0f74a6a3a3d8b9
|
data/lib/cul_hydra/indexer.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
module Cul::Hydra::Indexer
|
2
2
|
|
3
|
+
NUM_FEDORA_RETRY_ATTEMPTS = 3
|
4
|
+
DELAY_BETWEEN_FEDORA_RETRY_ATTEMPTS = 5.seconds
|
5
|
+
|
3
6
|
def self.descend_from(pid, pids_to_omit=nil, verbose_output=false)
|
4
7
|
if pid.blank?
|
5
8
|
raise 'Please supply a pid (e.g. rake recursively_index_fedora_objects pid=ldpd:123)'
|
@@ -66,7 +69,22 @@ module Cul::Hydra::Indexer
|
|
66
69
|
def self.index_pid(pid, skip_generic_resources=false, verbose_output=false)
|
67
70
|
# We found an object with the desired PID. Let's reindex it
|
68
71
|
begin
|
69
|
-
active_fedora_object =
|
72
|
+
active_fedora_object = nil
|
73
|
+
|
74
|
+
NUM_FEDORA_RETRY_ATTEMPTS.times { |i|
|
75
|
+
begin
|
76
|
+
active_fedora_object = ActiveFedora::Base.find(pid, :cast => true)
|
77
|
+
break
|
78
|
+
rescue RestClient::RequestTimeout, Errno::EHOSTUNREACH => e
|
79
|
+
remaining_attempts = (NUM_FEDORA_RETRY_ATTEMPTS-1) - i
|
80
|
+
if remaining_attempts == 0
|
81
|
+
raise e
|
82
|
+
else
|
83
|
+
Rails.logger.error "Error: Could not connect to fedora. (#{e.class.to_s + ': ' + e.message}). Will retry #{remaining_attempts} more #{remaining_attempts == 1 ? 'time' : 'times'} (after a #{DELAY_BETWEEN_FEDORA_RETRY_ATTEMPTS} second delay)."
|
84
|
+
sleep DELAY_BETWEEN_FEDORA_RETRY_ATTEMPTS
|
85
|
+
end
|
86
|
+
end
|
87
|
+
}
|
70
88
|
|
71
89
|
if skip_generic_resources && active_fedora_object.is_a?(GenericResource)
|
72
90
|
puts 'Object was skipped because GenericResources are being skipped and it is a GenericResource.'
|
data/lib/cul_hydra/version.rb
CHANGED
data/lib/cul_hydra/version.rb~
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_scv_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.9.
|
4
|
+
version: 0.22.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-03-
|
12
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
@@ -527,3 +527,4 @@ signing_key:
|
|
527
527
|
specification_version: 4
|
528
528
|
summary: ActiveFedora, OM, and Solrizer implementations for CUL repository apps
|
529
529
|
test_files: []
|
530
|
+
has_rdoc:
|