loga 2.6.0 → 2.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 +4 -4
- data/Appraisals +4 -0
- data/CHANGELOG.md +4 -0
- data/gemfiles/sidekiq61.gemfile +11 -0
- data/lib/loga/sidekiq6/job_logger.rb +16 -11
- data/lib/loga/version.rb +1 -1
- data/spec/loga/sidekiq6/job_logger_spec.rb +2 -0
- data/spec/spec_helper.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c431f4c2be4360f29975cc8434c86647c77cf8a375bcd8fa6e6a0b47bb8a2e8
|
4
|
+
data.tar.gz: 2ec1e76ed48281e99acca8bdc3dd55b3fb6068dee599dd5c4bf92008e1af6eb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c09402cb2b8f7e90bb53ccba07df43c759a9d4cea9cd5a19f8fbfcf332b0ce7914dca1d3c085cd43d9d081e40cc2c4d18452bd5c6b44d10e1df2771c7a88146
|
7
|
+
data.tar.gz: f9f937d8e0a600c05ca50e60c05b084d6756b76158f2b4dcfc7a070ee30ad535ef2df6f0c10d6f61a99152ec2fa2cdb1815b450ce600e4be72e51e797d1165b6
|
data/Appraisals
CHANGED
@@ -34,6 +34,10 @@ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.5.0')
|
|
34
34
|
appraise 'sidekiq6' do
|
35
35
|
gem 'sidekiq', '~> 6.0'
|
36
36
|
end
|
37
|
+
|
38
|
+
appraise 'sidekiq61' do
|
39
|
+
gem 'sidekiq', '~> 6.1.0'
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.7.0')
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [2.6.1] - 2022-02-22
|
8
|
+
### Fixed
|
9
|
+
- Fix compatibility with sidekiq 6.4.1
|
10
|
+
|
7
11
|
## [2.6.0] - 2021-12-22
|
8
12
|
### Added
|
9
13
|
- Allow using the gem with rails 7
|
@@ -10,22 +10,27 @@ module Loga
|
|
10
10
|
|
11
11
|
yield
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
end
|
13
|
+
::Sidekiq::Context.current[:elapsed] = elapsed(start)
|
14
|
+
|
15
|
+
loga_log(message: "#{item['class']} with jid: '#{item['jid']}' done", item: item)
|
18
16
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
::Sidekiq::Context.current[:elapsed] = elapsed(start)
|
18
|
+
|
19
|
+
loga_log(
|
20
|
+
message: "#{item['class']} with jid: '#{item['jid']}' fail", item: item,
|
21
|
+
exception: e
|
22
|
+
)
|
25
23
|
|
26
24
|
raise
|
27
25
|
end
|
28
26
|
|
27
|
+
def prepare(job_hash, &block)
|
28
|
+
super
|
29
|
+
ensure
|
30
|
+
# For sidekiq version < 6.4
|
31
|
+
Thread.current[:sidekiq_context] = nil
|
32
|
+
end
|
33
|
+
|
29
34
|
private
|
30
35
|
|
31
36
|
def loga_log(message:, item:, exception: nil)
|
data/lib/loga/version.rb
CHANGED
@@ -64,6 +64,7 @@ RSpec.describe Loga::Sidekiq6::JobLogger do
|
|
64
64
|
|
65
65
|
aggregate_failures do
|
66
66
|
expect(json_line).to include(expected_body)
|
67
|
+
expect(json_line['_duration']).to be_a(Float)
|
67
68
|
expect(json_line['timestamp']).to be_a(Float)
|
68
69
|
expect(json_line['host']).to be_a(String)
|
69
70
|
expect(json_line['short_message']).to match(/HardWorker with jid:*/)
|
@@ -110,6 +111,7 @@ RSpec.describe Loga::Sidekiq6::JobLogger do
|
|
110
111
|
|
111
112
|
aggregate_failures do
|
112
113
|
expect(&failed_job).to raise_error(StandardError)
|
114
|
+
expect(json_line['_duration']).to be_a(Float)
|
113
115
|
expect(json_line).to include(expected_body)
|
114
116
|
expect(json_line['timestamp']).to be_a(Float)
|
115
117
|
expect(json_line['host']).to be_a(String)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Funding Circle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -264,6 +264,7 @@ files:
|
|
264
264
|
- gemfiles/rails70.gemfile
|
265
265
|
- gemfiles/sidekiq51.gemfile
|
266
266
|
- gemfiles/sidekiq6.gemfile
|
267
|
+
- gemfiles/sidekiq61.gemfile
|
267
268
|
- gemfiles/sinatra14.gemfile
|
268
269
|
- gemfiles/unit.gemfile
|
269
270
|
- lib/loga.rb
|