cdmbl 0.2.19 → 0.2.20

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: c4de2069eb64be456e0e8c318985c1a8d2fb9d94
4
- data.tar.gz: 66f6849b0a4a95c946cd438c2706ede5fa1f9048
3
+ metadata.gz: 3d015ba13c6af1dbce4fdd610f1445c1e7a62050
4
+ data.tar.gz: 5374bec7147146fb4c69b1728013bb05ca51462e
5
5
  SHA512:
6
- metadata.gz: 99c9d162f60024e40be272a21e72ece5dec8db85f49166bb1b588901fde3453edceb9f8f156b07274255c4ec14fcf7b28971f6673ad93b9f46d19b88bccfa0a5
7
- data.tar.gz: 88add0ed3ad4495bc7a5afe3274b7ff792f98b368f0a895cbf96d2c1a3f845c7bb421f2a1d73a69c22f2d0aed6fb6d42d3aa2380250797bae9f14e666738ae39
6
+ metadata.gz: 77de9a18808ce929ad3ed8a1e920d62d2300e85608d5ea7afad8402a3d0e4cd31593c942264521d97ea17f455f6d0ca2c73822fd70744bf9154d87646dabdf51
7
+ data.tar.gz: 3a98ae96bf1dac23a5af699f4a057d658fbcd7b9c4100ca5b9122c61a93e0abc1705022880cfd17df8642ceccb5cf28173f7b6ce88312b6664f107812b5cb427
@@ -3,14 +3,17 @@ module CDMBL
3
3
  class ETLWorker
4
4
  attr_reader :solr_config,
5
5
  :etl_config,
6
+ :batch_size,
6
7
  :is_recursive,
7
8
  :identifiers,
8
9
  :deletables,
9
10
  :sets
10
11
 
11
12
  include Sidekiq::Worker
13
+
12
14
  def perform(solr_config,
13
15
  etl_config,
16
+ batch_size = 10,
14
17
  is_recursive = true,
15
18
  identifiers = [],
16
19
  deletables = [],
@@ -22,6 +25,7 @@ module CDMBL
22
25
  @identifiers = identifiers
23
26
  @deletables = deletables
24
27
  @sets = sets
28
+ @batch_size = batch_size
25
29
 
26
30
  if !identifiers.empty?
27
31
  load!
@@ -39,11 +43,12 @@ module CDMBL
39
43
 
40
44
  def ingest_batches!
41
45
  sent_deleted = false
42
- extraction.local_identifiers.each_slice(10) do |ids|
46
+ extraction.local_identifiers.each_slice(batch_size) do |ids|
43
47
  delete_ids = (sent_deleted == false) ? extraction.deletable_ids : []
44
48
  CDMBL::LoaderNotification.call!(ids, delete_ids)
45
49
  ETLWorker.perform_async(solr_config,
46
50
  etl_config,
51
+ batch_size,
47
52
  is_recursive,
48
53
  ids,
49
54
  delete_ids,
@@ -6,7 +6,8 @@ namespace :cdmbl do
6
6
  solr_config = { url: args[solr_url] }
7
7
  etl_config = { oai_endpoint: args[:oai_endpoint], cdm_endpoint: args[:cdm_endpoint], minimum_date: args[:minimum_date] }
8
8
  etl_config = (args[:resumption_token]) ? etl_cofig.merge(args[:resumption_token]) : etl_config
9
- CDMBL::ETLWorker.perform_async(solr_config, etl_config)
9
+ batch_size = (args[:batch_size]) ? args[:batch_size] : 10
10
+ CDMBL::ETLWorker.perform_async(solr_config, etl_config, batch_size)
10
11
  end
11
12
  end
12
13
 
data/lib/cdmbl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CDMBL
2
- VERSION = "0.2.19"
2
+ VERSION = "0.2.20"
3
3
  end
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.19
4
+ version: 0.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - chadfennell