lyber-core 4.0.2 → 4.0.3
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/lib/lyber_core/robot.rb +7 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fc34876430c8f4ffc5565b058178458e12055b1
|
4
|
+
data.tar.gz: e84c0b849c546a2df3904dea2b1f1f0bf6724fbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e21ec8b110238fd7354efd5aa8e3fbec5f8fcb15f9e31c3e5a1a008cd702edfc415342c247e74a4eb2a55e035fbbc34b7249d8e33eafdeb74ef14993f4d1a2c2
|
7
|
+
data.tar.gz: b24ee5613f2cd41e2774110cae826e977cd8e712bd9ea690c28e2ff93963486566aa7fad899c268d10a3fb03e040039739b18865f220faaeb574b354a8528e00
|
data/lib/lyber_core/robot.rb
CHANGED
@@ -46,6 +46,7 @@ module LyberCore
|
|
46
46
|
end
|
47
47
|
|
48
48
|
attr_accessor :check_queued_status
|
49
|
+
attr_reader :workflow_service
|
49
50
|
|
50
51
|
def initialize(repo, workflow_name, step_name, opts = {})
|
51
52
|
Signal.trap("QUIT") { puts "#{Process.pid} ignoring SIGQUIT" } # SIGQUIT ignored to let the robot finish
|
@@ -53,6 +54,7 @@ module LyberCore
|
|
53
54
|
@workflow_name = workflow_name
|
54
55
|
@step_name = step_name
|
55
56
|
@check_queued_status = opts.fetch(:check_queued_status, true)
|
57
|
+
@workflow_service = opts.fetch(:workflow_service, Dor::WorkflowService)
|
56
58
|
# create option to check return value of process_item
|
57
59
|
# @check_if_processed = opts.fetch(:check_if_processed, false)
|
58
60
|
end
|
@@ -72,21 +74,22 @@ module LyberCore
|
|
72
74
|
# otherwise, the robot did something like set the step to 'waiting' with a note
|
73
75
|
|
74
76
|
# update the workflow status from 'queued' to 'completed' -- errors out if current status is not queued
|
75
|
-
|
77
|
+
workflow_service.update_workflow_status @repo, druid, @workflow_name, @step_name, 'completed', :elapsed => elapsed, :note => Socket.gethostname, :current_status => 'queued'
|
76
78
|
LyberCore::Log.info "Finished #{druid} in #{sprintf("%0.4f",elapsed)}s"
|
77
79
|
rescue => e
|
78
80
|
begin
|
79
81
|
LyberCore::Log.error e.message + "\n" + e.backtrace.join("\n")
|
80
|
-
|
82
|
+
workflow_service.update_workflow_error_status @repo, druid , @workflow_name, @step_name, e.message, :error_text => Socket.gethostname
|
81
83
|
rescue => e2
|
82
84
|
LyberCore::Log.error "Cannot set #{druid} to status='error'\n" + e2.message + "\n" + e2.backtrace.join("\n")
|
83
85
|
raise e2 # send exception to Resque failed queue
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
87
|
-
|
89
|
+
private
|
90
|
+
|
88
91
|
def item_queued?(druid)
|
89
|
-
status =
|
92
|
+
status = workflow_service.get_workflow_status(@repo, druid, @workflow_name, @step_name)
|
90
93
|
if(status =~ /queued/i)
|
91
94
|
return true
|
92
95
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lyber-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alpana Pande
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2016-02
|
18
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: dor-workflow-service
|
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
version: 1.3.6
|
143
143
|
requirements: []
|
144
144
|
rubyforge_project:
|
145
|
-
rubygems_version: 2.4.
|
145
|
+
rubygems_version: 2.4.8
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Core services used by the SULAIR Digital Library
|