dor-workflow-service 1.6.0 → 1.6.1
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 +8 -8
- data/lib/dor/services/workflow_service.rb +4 -2
- data/lib/dor/workflow_version.rb +1 -1
- data/spec/workflow_service_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmM2ZWY5NDQyOWQ4NDZkMjhlZTY0OWE1MzA4YjU2OWViMDFjMWNkMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWI4MTUwOTkzMTgyOGQ1Njk4MTEwZWNiZDUyZTE5MTk2MDQ3YTA3Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjY4OGY2NWU1YjdmMjg0MTU2ZWM5MDg3Mzc0ZmQzOTQ4ZDg0MjZkNDcyMjBm
|
10
|
+
OGYzNTFmZGJjZjY4OGYzNzNkMTNiNjU4MDFmYTE4Mzk5NzM3ZDFjNDVlNGUy
|
11
|
+
MTg3NTc5NDkxMDJlOGQwZjJlNDI5OGVmNTYxMTJhYzdlYjIyYWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWYzNjBmZGRjNGRmYmIwZTc1MjM1NzU0NjA5NGJhM2Q0NjVlMWZlZTA2NDk5
|
14
|
+
MzJmZjFlYmFhYmUxNjAxMzEwZTUzYjc2MDU5ODUwZjliOTgxNjE5YTBkMDM5
|
15
|
+
Y2Q5Yzc0MWYzNTY0N2RmOTU4OWIyYTJhNmFiZjBiYWVmYjhlNWM=
|
@@ -323,7 +323,8 @@ module Dor
|
|
323
323
|
# This will enable re-queueing of jobs that have been lost by the job manager
|
324
324
|
# @param [String] repository name of the repository you want to query, like 'dor' or 'sdr'
|
325
325
|
# @param [Hash] opts optional values for query
|
326
|
-
# @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to
|
326
|
+
# @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to 0 hours,
|
327
|
+
# meaning you will get all queued workflows
|
327
328
|
# @option opts [Integer] :limit sets the maximum number of workflow steps that can be returned. Defaults to no limit
|
328
329
|
# @return [Array[Hash]] each Hash represents a workflow step. It will have the following keys:
|
329
330
|
# :workflow, :step, :druid, :priority
|
@@ -336,7 +337,8 @@ module Dor
|
|
336
337
|
# Returns a count of workflow steps that have a status of 'queued' that have a last-updated timestamp older than the number of hours passed in
|
337
338
|
# @param [String] repository name of the repository you want to query, like 'dor' or 'sdr'
|
338
339
|
# @param [Hash] opts optional values for query
|
339
|
-
# @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to
|
340
|
+
# @option opts [Integer] :hours_ago steps older than this value will be returned by the query. If not passed in, the service defaults to 0 hours,
|
341
|
+
# meaning you will get all queued workflows
|
340
342
|
# @return [Integer] number of stale, queued steps if the :count_only option was set to true
|
341
343
|
def count_stale_queued_workflows(repository, opts = {})
|
342
344
|
uri_string = build_queued_uri(repository, opts)
|
data/lib/dor/workflow_version.rb
CHANGED
@@ -303,7 +303,7 @@ describe Dor::WorkflowService do
|
|
303
303
|
end
|
304
304
|
end
|
305
305
|
|
306
|
-
describe ".
|
306
|
+
describe ".get_stale_queued_workflows" do
|
307
307
|
it "returns an Array of Hashes containing each workflow step" do
|
308
308
|
xml = <<-XML
|
309
309
|
<workflows>
|
@@ -311,10 +311,12 @@ describe Dor::WorkflowService do
|
|
311
311
|
<workflow priority="30" note="annotation" lifecycle="in-process" errorText="stacktrace" errorMessage="NullPointerException" elapsed="1.173" repository="dor" attempts="0" datetime="2008-11-15T13:30:00-0800" status="waiting" process="jp2-create" name="assemblyWF" druid="dr:456"/>
|
312
312
|
</workflows>
|
313
313
|
XML
|
314
|
+
@mock_resource.should_receive(:[]).with("workflow_queue/all_queued?repository=dor&hours-ago=24&limit=100")
|
315
|
+
@mock_resource.should_receive(:get).and_return(xml)
|
316
|
+
|
317
|
+
ah = Dor::WorkflowService.get_stale_queued_workflows 'dor', :hours_ago => 24, :limit => 100
|
314
318
|
expected = [ { :workflow => 'accessionWF', :step => 'content-metadata', :druid => 'dr:123', :priority => 30},
|
315
319
|
{ :workflow => 'assemblyWF', :step => 'jp2-create', :druid => 'dr:456', :priority => 30} ]
|
316
|
-
|
317
|
-
ah = Dor::WorkflowService.parse_queued_workflows_response(xml)
|
318
320
|
ah.should eql(expected)
|
319
321
|
end
|
320
322
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-workflow-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willy Mene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|