Commit f8020b09d38a529f9f0ba29c8cbf08fab5ef1fef

Authored by Victor Costa
1 parent 92747293

virtuoso: fix dspace harvest

plugins/virtuoso/lib/virtuoso_plugin/dspace_harvest.rb
@@ -35,14 +35,18 @@ class VirtuosoPlugin::DspaceHarvest @@ -35,14 +35,18 @@ class VirtuosoPlugin::DspaceHarvest
35 def run 35 def run
36 harvest_time = Time.now.utc 36 harvest_time = Time.now.utc
37 params = settings.last_harvest ? {:from => settings.last_harvest.utc} : {} 37 params = settings.last_harvest ? {:from => settings.last_harvest.utc} : {}
38 - puts "starting harvest #{params}" 38 + puts "starting harvest #{params} #{settings.dspace_uri} #{settings.virtuoso_uri}"
39 begin 39 begin
40 records = dspace_client.list_records(params) 40 records = dspace_client.list_records(params)
41 records.each do |record| 41 records.each do |record|
42 triplify(record) 42 triplify(record)
43 end 43 end
44 - rescue Exception => ex 44 + rescue OAI::Exception => ex
45 puts ex.to_s 45 puts ex.to_s
  46 + if ex.code != 'noRecordsMatch'
  47 + puts "unexpected error"
  48 + raise ex
  49 + end
46 end 50 end
47 settings.last_harvest = harvest_time 51 settings.last_harvest = harvest_time
48 settings.save! 52 settings.save!