lyber-core 6.0.0 → 6.1.0

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
  SHA256:
3
- metadata.gz: '0786ae4b4aa512ea86d9a147d4002d141fc2658e8f52b533056c658dee6d727e'
4
- data.tar.gz: fd8b91265cbf0f5aa5c456d2f7edd88c4d7fd8c4fad019bd99df403021e7dd39
3
+ metadata.gz: 1782e67d9093e1626e046f38c5952020d16664350d950ec01cda9790d4dfef4d
4
+ data.tar.gz: 8b57bb3810932c6f5ccc5d796f8ee397e0d8e6aab5a72211f29261816f65e72f
5
5
  SHA512:
6
- metadata.gz: 2c250695948c1c111c181886b8d03ffe23475a8c5ce020da62f67782710a682ac0f9cbbe1952e1efe36eb9d20363c63049477a01b47763770862ba7e200e1da2
7
- data.tar.gz: 665ab707ba5e5603440dc1c9ee3b8f1b0ac67dc7bc213f441baeb1525070f8e3f1b2eaee317ad3d283216ba3d304574b898b2bd92c11d42182545c906be3d7cf
6
+ metadata.gz: dc9eb98caf13bec01711b2326dbc3d2635054669fb1c8e13577b0953939231a2c1b567b4183e73432a11fcb587335b5abef29b64a8f2b94f8f2275c9682d4ad6
7
+ data.tar.gz: 7d06278ab9fbcb5d41a48abd9c3691fb3cbf6215b484c601aa39fbf451456e1cebe469cd1df487d3608b7b81cdf882fcb080507ebd0ac583e55762b06a7b4302
@@ -92,14 +92,14 @@ module LyberCore
92
92
  @@log.add(Logger::DEBUG) { msg }
93
93
  end
94
94
 
95
- def Log.exception(e)
96
- msg = Log.exception_message(e)
95
+ def Log.exception(exc)
96
+ msg = Log.exception_message(exc)
97
97
  Log.error(msg)
98
98
  end
99
99
 
100
- def Log.exception_message(e)
101
- msg = e.inspect.split($/).join('; ') + "\n"
102
- msg << e.backtrace.join("\n") if e.backtrace
100
+ def Log.exception_message(exc)
101
+ msg = exc.inspect.split($/).join('; ') + "\n"
102
+ msg << exc.backtrace.join("\n") if exc.backtrace
103
103
  end
104
104
  end
105
105
  end
@@ -8,7 +8,7 @@ module LyberCore
8
8
  class ReturnState
9
9
  attr_reader :status
10
10
  attr_accessor :note
11
- ALLOWED_RETURN_STATES = %w[completed skipped waiting].freeze
11
+ ALLOWED_RETURN_STATES = %w[completed skipped waiting noop].freeze
12
12
  DEFAULT_RETURN_STATE = 'completed'
13
13
 
14
14
  def initialize(params = {})
@@ -34,11 +34,14 @@ module LyberCore
34
34
 
35
35
  # Sets up logging, timing and error handling of the job
36
36
  # Calls the #perform method, then sets workflow to 'completed' or 'error' depending on success
37
+ # rubocop:disable Metrics/AbcSize
38
+ # rubocop:disable Metrics/CyclomaticComplexity
39
+ # rubocop:disable Metrics/PerceivedComplexity
37
40
  def work(druid)
38
41
  Honeybadger.context(druid: druid, process: process, workflow_name: workflow_name) if defined? Honeybadger
39
42
  workflow = workflow(druid)
40
43
  LyberCore::Log.set_logfile($stdout) # let process manager(bluepill) handle logging
41
- LyberCore::Log.info "#{druid} processing"
44
+ LyberCore::Log.info "#{druid} processing #{process} (#workflow_name)"
42
45
  return if check_queued_status && !item_queued?(druid)
43
46
 
44
47
  # this is the default note to pass back to workflow service,
@@ -64,7 +67,8 @@ module LyberCore
64
67
  workflow_state = 'completed'
65
68
  end
66
69
  # update the workflow status from its current state to the state returned by perform (or 'completed' as the default)
67
- workflow.complete(workflow_state, elapsed, note)
70
+ # noop allows a robot to not set a workflow as complete, e.g., if that is delegated to another service.
71
+ workflow.complete(workflow_state, elapsed, note) unless workflow_state == 'noop'
68
72
 
69
73
  LyberCore::Log.info "Finished #{druid} in #{sprintf('%0.4f', elapsed)}s"
70
74
  rescue StandardError => e
@@ -77,6 +81,9 @@ module LyberCore
77
81
  raise e # send exception to Resque failed queue
78
82
  end
79
83
  end
84
+ # rubocop:enable Metrics/AbcSize
85
+ # rubocop:enable Metrics/CyclomaticComplexity
86
+ # rubocop:enable Metrics/PerceivedComplexity
80
87
 
81
88
  private
82
89
 
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: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alpana Pande
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2020-02-06 00:00:00.000000000 Z
19
+ date: 2020-02-19 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: coveralls