cdmbl 0.2.18 → 0.2.19

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: 225abdb6fb7f5c6a404a4a6591ca51ede7d3330c
4
- data.tar.gz: 48ca0b917c6a313fc14a43c204efd28a35642390
3
+ metadata.gz: c4de2069eb64be456e0e8c318985c1a8d2fb9d94
4
+ data.tar.gz: 66f6849b0a4a95c946cd438c2706ede5fa1f9048
5
5
  SHA512:
6
- metadata.gz: c1b8bd45ce1fc1149ccc64c8edc9bd4b9413c83a287630ecff8b78f16373fae6d8e87a3bba2c292a7f7c8be628be45a2d07ee2a94c0b2f85c7c478f97a5712af
7
- data.tar.gz: 607e7c2c4eeea7633c3cbcb12f0655333b49750dc989209406a283027b43041a7691c961340e8c6ab088d0c9d1e1e12eb23bd4c142a8eb22db0b22fae30147fa
6
+ metadata.gz: 99c9d162f60024e40be272a21e72ece5dec8db85f49166bb1b588901fde3453edceb9f8f156b07274255c4ec14fcf7b28971f6673ad93b9f46d19b88bccfa0a5
7
+ data.tar.gz: 88add0ed3ad4495bc7a5afe3274b7ff792f98b368f0a895cbf96d2c1a3f845c7bb421f2a1d73a69c22f2d0aed6fb6d42d3aa2380250797bae9f14e666738ae39
@@ -0,0 +1,8 @@
1
+ module CDMBL
2
+ # An example callback
3
+ class DefaultLoaderNotification
4
+ def self.call!(ingestables, deletables)
5
+ puts "A CONTENTdm API request notification: Loading #{ingestables.length} records and deleting #{deletables.length}"
6
+ end
7
+ end
8
+ end
@@ -38,13 +38,17 @@ module CDMBL
38
38
  private
39
39
 
40
40
  def ingest_batches!
41
+ sent_deleted = false
41
42
  extraction.local_identifiers.each_slice(10) do |ids|
43
+ delete_ids = (sent_deleted == false) ? extraction.deletable_ids : []
44
+ CDMBL::LoaderNotification.call!(ids, delete_ids)
42
45
  ETLWorker.perform_async(solr_config,
43
46
  etl_config,
44
47
  is_recursive,
45
48
  ids,
46
- extraction.deletable_ids,
49
+ delete_ids,
47
50
  extraction.set_lookup)
51
+ sent_deleted = true
48
52
  end
49
53
  end
50
54
 
data/lib/cdmbl/hooks.rb CHANGED
@@ -6,6 +6,8 @@ module CDMBL
6
6
  hook(pattern: name.to_s, default: DefaultCompletedCallback)
7
7
  elsif name.to_s == 'OaiNotification'
8
8
  hook(pattern: name.to_s, default: DefaultOaiNotification)
9
+ elsif name.to_s == 'LoaderNotification'
10
+ hook(pattern: name.to_s, default: DefaultLoaderNotification)
9
11
  elsif name.to_s == 'CdmNotification'
10
12
  hook(pattern: name.to_s, default: DefaultCdmNotification)
11
13
  end
data/lib/cdmbl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CDMBL
2
- VERSION = "0.2.18"
2
+ VERSION = "0.2.19"
3
3
  end
data/lib/cdmbl.rb CHANGED
@@ -14,5 +14,6 @@ require 'cdmbl/etl_worker'
14
14
  require 'cdmbl/default_completed_callback'
15
15
  require 'cdmbl/default_cdm_notification'
16
16
  require 'cdmbl/default_oai_notification'
17
+ require 'cdmbl/default_loader_notification'
17
18
  require 'cdmbl/hooks'
18
19
  require 'cdmbl/oai_filter'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdmbl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - chadfennell
@@ -210,6 +210,7 @@ files:
210
210
  - lib/cdmbl.rb
211
211
  - lib/cdmbl/default_cdm_notification.rb
212
212
  - lib/cdmbl/default_completed_callback.rb
213
+ - lib/cdmbl/default_loader_notification.rb
213
214
  - lib/cdmbl/default_oai_notification.rb
214
215
  - lib/cdmbl/default_solr.rb
215
216
  - lib/cdmbl/etl_run.rb