cul_hydra 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec8bcbc10fdf68d670dfe01746875af54bdd5c10
4
- data.tar.gz: d79c8eca60c517ec40c7fd010962502b298f1154
3
+ metadata.gz: a6c16baa2ef730a8f4395653c3cf9019198bfc55
4
+ data.tar.gz: 624fc473557df969fe8b68c17bd20072c8efa511
5
5
  SHA512:
6
- metadata.gz: 38dfe5a01b4b1dfa97aad20497da68419c28a0f655fb8a674abff65447b9300c95dfd0ca38ebd19a8509298d7d47ddfad5ad6bd4981d17ae3279e079c4989fe8
7
- data.tar.gz: 8d1f02b7ce37cc6f4ddfe7bab87631d8031b0dc212e2c4809678114b2c5af996bc8c0e6794cfc12315edf10a094aa50aa538cfa26695d526168013c8e47d33c3
6
+ metadata.gz: 7f12d945a86cf19b4fb52717760f86e3eb7d5528a1bb8d0531f04648cc26d1bb06dfdf9a850674c6916237ad03056384f75a17d2a5e86d8aad87a76b7e58d029
7
+ data.tar.gz: 57d55f4e9f8bf8948ec96b2a2a0541352415b0b5b497ee300eb1a74da0074a715392a6402f69aca1a1ebf0c5b6085b04cc5ba233730525642b170b4743b8ca0c
@@ -71,9 +71,15 @@ module Cul::Hydra::Indexer
71
71
  begin
72
72
  active_fedora_object = nil
73
73
 
74
- NUM_FEDORA_RETRY_ATTEMPTS.times { |i|
74
+ NUM_FEDORA_RETRY_ATTEMPTS.times do |i|
75
75
  begin
76
76
  active_fedora_object = ActiveFedora::Base.find(pid, :cast => true)
77
+ if skip_generic_resources && active_fedora_object.is_a?(GenericResource)
78
+ puts 'Object was skipped because GenericResources are being skipped and it is a GenericResource.'
79
+ else
80
+ active_fedora_object.update_index
81
+ puts 'done.' if verbose_output
82
+ end
77
83
  break
78
84
  rescue RestClient::RequestTimeout, Errno::EHOSTUNREACH => e
79
85
  remaining_attempts = (NUM_FEDORA_RETRY_ATTEMPTS-1) - i
@@ -83,20 +89,23 @@ module Cul::Hydra::Indexer
83
89
  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
90
  sleep DELAY_BETWEEN_FEDORA_RETRY_ATTEMPTS
85
91
  end
92
+ rescue RuntimeError => e
93
+ if e.message.index('Circular dependency detected while autoloading')
94
+ # The RuntimeError 'Circular dependency detected while autoloading CLASSNAME' comes up when
95
+ # we're doing multithreaded indexing. The solution to this problem is to just wait a few
96
+ # seconds for the class to autoload and then to continue, so a retry is appropriate here.
97
+ sleep 5
98
+ else
99
+ # Other RuntimeErrors should be passed on
100
+ raise e
101
+ end
86
102
  end
87
- }
88
-
89
- if skip_generic_resources && active_fedora_object.is_a?(GenericResource)
90
- puts 'Object was skipped because GenericResources are being skipped and it is a GenericResource.'
91
- else
92
- active_fedora_object.update_index
93
- puts 'done.' if verbose_output
94
103
  end
95
104
  rescue SystemExit, Interrupt => e
96
105
  # Allow system interrupt (ctrl+c)
97
106
  raise e
98
107
  rescue Exception => e
99
- puts "Encountered problem with #{pid}. Skipping record. Exception: #{e.message}"
108
+ puts "Encountered problem with #{pid}. Skipping record. Exception class: #{e.class.name}. Message: #{e.message}"
100
109
  end
101
110
  end
102
111
  end
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '1.3.8'
3
+ VERSION = '1.3.9'
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 = '1.3.7'
3
+ VERSION = '1.3.8'
4
4
  def self.version
5
5
  VERSION
6
6
  end
data/lib/tasks/index.rake CHANGED
@@ -64,11 +64,14 @@ namespace :cul_hydra do
64
64
 
65
65
  skip_generic_resources = (ENV['skip_generic_resources'] == 'true')
66
66
 
67
- ### Stop excessive ActiveFedora logging ###
68
- # initialize the fedora connection if necessary
69
- connection = (ActiveFedora::Base.fedora_connection[0] ||= ActiveFedora::RubydoraConnection.new(ActiveFedora.config.credentials)).connection
70
- # the logger accessor is private
71
- (connection.api.send :logger).level = Logger::INFO
67
+ # Update (2016-02-22): (connection.api.send :logger) returns nil, but we aren't
68
+ # seeing debug level ActiveFedora logging anymore, so we should be okay without this.
69
+
70
+ #### Stop excessive ActiveFedora logging ###
71
+ ## initialize the fedora connection if necessary
72
+ #connection = (ActiveFedora::Base.fedora_connection[0] ||= ActiveFedora::RubydoraConnection.new(ActiveFedora.config.credentials)).connection
73
+ ## the logger accessor is private
74
+ #(connection.api.send :logger).level = Logger::INFO
72
75
 
73
76
  start_time = Time.now
74
77
  pids = Cul::Hydra::RisearchMembers.get_project_constituent_pids(project_pid, true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
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: 2016-02-22 00:00:00.000000000 Z
12
+ date: 2016-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight