inst-jobs 3.0.12 → 3.0.13

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: ee779fa187d057bce265940ca1c9c2944bdf096ab198060e0819ff40dd02358b
4
- data.tar.gz: bc930f9dc0ca659df54388753dc9aa26402c866023b7f275155897ccca35ebf4
3
+ metadata.gz: c1369efb0e72de3f01f922b7f77a95a6c5dd1979aaec11cfd76cdc4507202428
4
+ data.tar.gz: 244a543711c3ceab301f4ea0f30bb238e47330921059ec27133a7a2de44389f7
5
5
  SHA512:
6
- metadata.gz: bd24bd19e153cb7f48b33911e38fbd9657de396baad1c32286d5a4acb899d23f9d97c627914c095647006129f5c0ebc008e7e07b311f3d33b89819e400cce756
7
- data.tar.gz: 005e7e0a637b1e5a3fcae2b7e22edfb2af604da2328e273f512b4747dacb4d723afc06bd4846246c3fc541f72ca7068123c98bf26b52e2964f7eaa45dba6b609
6
+ metadata.gz: '09ce7c560febe39082502641d62e9309f515d026eb95d840e3645fbb2725d9eb6c70f2b147402a44d462bc5761c8f4727739e87a7f4a6acbed391868ae024d2e'
7
+ data.tar.gz: d0332dc2e652adf67b93f61122d535a7e48f20d48e9d66a08d2e5fc75d08c4be1c7e15b4656c7f1bfc4102a389bd23d256b4d43cb88b914e98ce9a0ea67ddd3c
@@ -33,6 +33,7 @@ module Delayed
33
33
 
34
34
  SETTINGS_WITH_ARGS = %i[
35
35
  job_detailed_log_format
36
+ job_short_log_format
36
37
  num_strands
37
38
  ].freeze
38
39
 
@@ -137,6 +138,7 @@ module Delayed
137
138
  self.job_detailed_log_format = lambda { |job|
138
139
  job.to_json(include_root: false, only: %w[tag strand singleton priority attempts created_at max_attempts source])
139
140
  }
141
+ self.job_short_log_format = ->(_job) { "" }
140
142
 
141
143
  # Send workers KILL after QUIT if they haven't exited within the
142
144
  # slow_exit_timeout
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delayed
4
- VERSION = "3.0.12"
4
+ VERSION = "3.0.13"
5
5
  end
@@ -220,7 +220,7 @@ module Delayed
220
220
  end
221
221
  job.destroy
222
222
  end
223
- logger.info("Completed #{log_job(job)} #{format('%.0fms', (runtime * 1000))}")
223
+ logger.info("Completed #{log_job(job, :short)} #{format('%.0fms', (runtime * 1000))}")
224
224
  end
225
225
  rescue ::Delayed::RetriableError => e
226
226
  can_retry = job.attempts + 1 < job.inferred_max_attempts
@@ -269,7 +269,7 @@ module Delayed
269
269
  when :long
270
270
  "#{job.full_name} #{Settings.job_detailed_log_format.call(job)}"
271
271
  else
272
- job.full_name
272
+ "#{job.full_name} #{Settings.job_short_log_format.call(job)}".strip
273
273
  end
274
274
  end
275
275
 
@@ -85,13 +85,14 @@ describe Delayed::Worker do
85
85
  end
86
86
 
87
87
  it "logging format can be changed with settings" do
88
- Delayed::Settings.job_detailed_log_format = ->(job) { "override format #{job.strand}" }
88
+ Delayed::Settings.job_detailed_log_format = ->(job) { "override format detailed #{job.strand}" }
89
+ Delayed::Settings.job_short_log_format = ->(_job) { "override format short" }
89
90
  payload = double(perform: nil)
90
91
  job = Delayed::Job.new(payload_object: payload, priority: 25, strand: "test_jobs")
91
92
  short_log_format = subject.log_job(job, :short)
92
- expect(short_log_format).to eq("RSpec::Mocks::Double")
93
+ expect(short_log_format).to eq("RSpec::Mocks::Double override format short")
93
94
  long_format = subject.log_job(job, :long)
94
- expect(long_format).to eq("RSpec::Mocks::Double override format test_jobs")
95
+ expect(long_format).to eq("RSpec::Mocks::Double override format detailed test_jobs")
95
96
  end
96
97
  end
97
98
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.12
4
+ version: 3.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-03-30 00:00:00.000000000 Z
13
+ date: 2022-04-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord