ddr-batch 1.2.0.rc1 → 1.2.0.rc2
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 +4 -4
- data/app/mailers/ddr/batch/batch_processor_run_mailer.rb +3 -0
- data/app/models/ddr/batch/batch.rb +4 -0
- data/app/services/ddr/batch/monitor_batch_finished.rb +1 -1
- data/app/services/ddr/batch/monitor_batch_object_handled.rb +0 -5
- data/app/views/ddr/batch/batch_processor_run_mailer/send_notification.html.erb +5 -5
- data/app/views/ddr/batch/batch_processor_run_mailer/send_notification.text.erb +5 -5
- data/db/migrate/20161222192611_remove_columns_from_batch.rb +13 -0
- data/lib/ddr/batch/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6af55cc37d93326bdcad084634c17b1ef3206412
|
4
|
+
data.tar.gz: 806152ec7c04f3f88eda1b325f9c72cc814fe523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d1d932ba6ebc49a97e81a0f127b2b0bc60c05cf189322fd704db0ec7fc12ff74b2c8f5f4839de1df7f3d3530306d548a631ceb0f11cf8f40dec05df6ae1c89d
|
7
|
+
data.tar.gz: 9472b3ccec76010514e8e529aebc01ae0c56369308cb601c859ce22cc8986b4933d7870eaf34e5f601764c5a905cad59eee4a21d891481960f52df2a8561f4af
|
@@ -9,6 +9,9 @@ module Ddr::Batch
|
|
9
9
|
@title = "Batch Processor Run #{@batch.status} #{@batch.outcome}"
|
10
10
|
@host = `uname -n`.strip
|
11
11
|
@subject = "[#{@host}] #{@title}"
|
12
|
+
@size = @batch.batch_objects.size
|
13
|
+
@handled = @batch.handled_count
|
14
|
+
@success = @batch.success_count
|
12
15
|
from = "#{`echo $USER`.strip}@#{@host}"
|
13
16
|
attachments["details.txt"] = File.read(@batch.logfile.path)
|
14
17
|
mail(from: from, to: @batch.user.email, subject: @subject)
|
@@ -60,7 +60,7 @@ module Ddr::Batch
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def update_batch(batch)
|
63
|
-
outcome = batch.
|
63
|
+
outcome = batch.success_count.eql?(batch.batch_objects.size) ? Batch::OUTCOME_SUCCESS : Batch::OUTCOME_FAILURE
|
64
64
|
logfile = File.new(Ddr::Batch::Log.file_path(batch.id))
|
65
65
|
batch.update!(stop: DateTime.now,
|
66
66
|
status: Batch::STATUS_FINISHED,
|
@@ -13,7 +13,6 @@ module Ddr::Batch
|
|
13
13
|
|
14
14
|
def batch_object_handled(batch_object, batch)
|
15
15
|
log_batch_object_messages(batch_object, batch.id)
|
16
|
-
update_batch(batch_object, batch)
|
17
16
|
unless batch.unhandled_objects?
|
18
17
|
ActiveSupport::Notifications.instrument('finished.batch.batch.ddr', batch_id: batch.id)
|
19
18
|
end
|
@@ -26,10 +25,6 @@ module Ddr::Batch
|
|
26
25
|
end
|
27
26
|
logger.close
|
28
27
|
end
|
29
|
-
|
30
|
-
def update_batch(batch_object, batch)
|
31
|
-
batch_object.verified? ? batch.update!(success: batch.success + 1) : batch.update!(failure: batch.failure + 1)
|
32
|
-
end
|
33
28
|
end
|
34
29
|
|
35
30
|
end
|
@@ -22,13 +22,13 @@ td { text-align: right; }
|
|
22
22
|
Outcome: <%= @batch.outcome %>
|
23
23
|
</p>
|
24
24
|
<p>
|
25
|
-
Objects in batch: <%= @
|
26
|
-
Successfully processed: <%= @
|
27
|
-
Processing failures: <%= @
|
28
|
-
Unprocessed: <%= @
|
25
|
+
Objects in batch: <%= @size %><br />
|
26
|
+
Successfully processed: <%= @success %><br />
|
27
|
+
Processing failures: <%= @handled - @success %><br />
|
28
|
+
Unprocessed: <%= @size - @handled %>
|
29
29
|
</p>
|
30
30
|
<p>
|
31
31
|
See attachment for details of batch run.
|
32
32
|
</p>
|
33
33
|
</body>
|
34
|
-
</html>
|
34
|
+
</html>
|
@@ -12,9 +12,9 @@ Stopped at: <%= @batch.stop %>
|
|
12
12
|
Status: <%= @batch.status %>
|
13
13
|
Outcome: <%= @batch.outcome %>
|
14
14
|
|
15
|
-
Objects in batch: <%= @
|
16
|
-
Successfully processed: <%= @
|
17
|
-
Processing failures: <%= @
|
18
|
-
Unprocessed: <%= @
|
15
|
+
Objects in batch: <%= @size %>
|
16
|
+
Successfully processed: <%= @success %>
|
17
|
+
Processing failures: <%= @handled - @success %>
|
18
|
+
Unprocessed: <%= @size - @handled %>
|
19
19
|
|
20
|
-
See attachment for details of batch run.
|
20
|
+
See attachment for details of batch run.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class RemoveColumnsFromBatch < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
remove_column :batches, :failure
|
4
|
+
remove_column :batches, :success
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
change_table :batches do |t|
|
9
|
+
t.integer "failure", default: 0
|
10
|
+
t.integer "success", default: 0
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/ddr/batch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddr-batch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0.
|
4
|
+
version: 1.2.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Coble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- db/migrate/20160816164010_create_batch_object_roles.rb
|
211
211
|
- db/migrate/20161115191636_add_columns_to_batch_object.rb
|
212
212
|
- db/migrate/20161116142512_create_batch_object_messages.rb
|
213
|
+
- db/migrate/20161222192611_remove_columns_from_batch.rb
|
213
214
|
- lib/ddr-batch.rb
|
214
215
|
- lib/ddr/batch.rb
|
215
216
|
- lib/ddr/batch/batch_user.rb
|