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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4dfef7d4cc06013efb54de0725d882d49b043d6b
4
- data.tar.gz: 6fb3fcdb39e0ed72bd1c6002efa969bd7edaeb12
3
+ metadata.gz: 74eb59743de94c1af1a616faf50cca6ec1db46a3
4
+ data.tar.gz: cc5710e6808263fd1b746c38c654a3c9b7d3384e
5
5
  SHA512:
6
- metadata.gz: efdfeea63e0d34298a29015048ee81ea86945d97f3dd1585e61f68376ec90cee6ddc70ed7af4b82d79bbf44b8cf5adfb38a21906fb0d305e7f7a5a244a620d38
7
- data.tar.gz: fc309b63eb069ccdae2169b4bf4cd86c4898a3de41958a8780d4737d07bf96fc05e4d44ff3fc783943bed28df89268d5f1fb992ef9892d98c587f75272a5dbeb
6
+ metadata.gz: db5c72d0990e346aca07e8ac9a01005910b011b8cd381b5b685a6f7a159d6ea34dd3e09c9f41088520cb64e846569289aa7ec9df5436d6aad4a47feac40b0234
7
+ data.tar.gz: 5e3e4a18eae4648d84605e8599c10fad3384d66bd98dae27642713ccf4f1befa93752515a6ba33000007fcf52f28e98d15c69066e92beed4eb0f74a6a3a3d8b9
@@ -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 = ActiveFedora::Base.find(pid, :cast => true)
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.'
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '0.22.9.2'
3
+ VERSION = '0.22.9.3'
4
4
  def self.version
5
5
  VERSION
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '0.22.9.1'
3
+ VERSION = '0.22.9.2'
4
4
  def self.version
5
5
  VERSION
6
6
  end
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.2
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 00:00:00.000000000 Z
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: