sidekiq_metered_exceptions 0.2.1 → 0.3.3

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
  SHA1:
3
- metadata.gz: 5559035e512931e92f57dc4f549b8745dcfc2fe4
4
- data.tar.gz: deb9de3d744473dadb9ff1faf2657400ea041cdd
3
+ metadata.gz: bc937fac34504b327d11e95bacd4b86a5d5c72f4
4
+ data.tar.gz: 7815de00fff56b82ad0fac3eb1b34894e1204405
5
5
  SHA512:
6
- metadata.gz: 3c2a22180c1be3f17c813a15c083e6ae017f3ea087715da959e978964ff704244c1b1275c80f2b2aa3c0830450f2d033530623f91efb2134b97b5b191973fb65
7
- data.tar.gz: bbfb6c1aed680e9ca810ffafdda4ef8afdbaf52cd988478bab9a9dea2d0a18237717e0026c71513a4e435aad62f1d998f939e5fd919e101c013b507ac16804bd
6
+ metadata.gz: 459dd9ded4400d9458de49240438b58d82be2ea271955db6a20950364257774fed630c7b2732f567d4f0a7a89e753130b2f49ffcf6173f80d457a96bd27f6ee5
7
+ data.tar.gz: ec516b73d69aa95e727428f27615bbdc888975955b175145f7017cf403dda9233a43c102a16a2e2be9610c0d86758dec9bd602e5d9b812ff2988fb7e48bbb439
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.5.0)
5
- public_suffix (~> 2.0, >= 2.0.2)
4
+ addressable (2.4.0)
6
5
  builder (3.2.3)
7
6
  celluloid (0.14.1)
8
7
  timers (>= 1.0.0)
@@ -12,47 +11,46 @@ GEM
12
11
  faraday (0.9.2)
13
12
  multipart-post (>= 1.2, < 3)
14
13
  git (1.3.0)
15
- github_api (0.11.3)
16
- addressable (~> 2.3)
17
- descendants_tracker (~> 0.0.1)
14
+ github_api (0.16.0)
15
+ addressable (~> 2.4.0)
16
+ descendants_tracker (~> 0.0.4)
18
17
  faraday (~> 0.8, < 0.10)
19
- hashie (>= 1.2)
20
- multi_json (>= 1.7.5, < 2.0)
21
- nokogiri (~> 1.6.0)
22
- oauth2
23
- hashie (3.4.6)
24
- highline (1.7.8)
25
- jeweler (2.3.2)
18
+ hashie (>= 3.4)
19
+ mime-types (>= 1.16, < 3.0)
20
+ oauth2 (~> 1.0)
21
+ hashie (3.5.7)
22
+ highline (1.7.10)
23
+ jeweler (2.3.9)
26
24
  builder
27
- bundler (>= 1.0)
25
+ bundler
28
26
  git (>= 1.2.5)
29
- github_api (~> 0.11.0)
27
+ github_api (~> 0.16.0)
30
28
  highline (>= 1.6.15)
31
29
  nokogiri (>= 1.5.10)
32
- psych (~> 2.2)
30
+ psych
33
31
  rake
34
32
  rdoc
35
33
  semver2
36
34
  json (2.0.3)
37
35
  jwt (1.5.6)
38
- mini_portile2 (2.1.0)
36
+ mime-types (2.99.3)
37
+ mini_portile2 (2.3.0)
39
38
  minitest (5.0.4)
40
- multi_json (1.12.1)
39
+ multi_json (1.13.1)
41
40
  multi_xml (0.6.0)
42
41
  multipart-post (2.0.0)
43
- nokogiri (1.6.8.1)
44
- mini_portile2 (~> 2.1.0)
45
- oauth2 (1.3.0)
46
- faraday (>= 0.8, < 0.11)
42
+ nokogiri (1.8.2)
43
+ mini_portile2 (~> 2.3.0)
44
+ oauth2 (1.4.0)
45
+ faraday (>= 0.8, < 0.13)
47
46
  jwt (~> 1.0)
48
47
  multi_json (~> 1.3)
49
48
  multi_xml (~> 0.5)
50
49
  rack (>= 1.2, < 3)
51
- psych (2.2.2)
52
- public_suffix (2.0.5)
53
- rack (2.0.1)
54
- rake (12.0.0)
55
- rdoc (5.0.0)
50
+ psych (3.0.2)
51
+ rack (2.0.4)
52
+ rake (12.3.1)
53
+ rdoc (6.0.3)
56
54
  redis (3.0.4)
57
55
  redis-namespace (1.3.0)
58
56
  redis (~> 3.0.0)
@@ -65,7 +63,7 @@ GEM
65
63
  json
66
64
  redis (>= 3.0)
67
65
  redis-namespace
68
- thread_safe (0.3.5)
66
+ thread_safe (0.3.6)
69
67
  timers (1.1.0)
70
68
 
71
69
  PLATFORMS
@@ -80,4 +78,4 @@ DEPENDENCIES
80
78
  sidekiq
81
79
 
82
80
  BUNDLED WITH
83
- 1.13.7
81
+ 1.16.1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.3
@@ -2,12 +2,27 @@ require 'sidekiq'
2
2
  require 'raven/integrations/sidekiq'
3
3
 
4
4
  module SidekiqMeteredExceptions
5
- class MeteredRavenErrorHandler < ::Raven::Sidekiq
6
- def call(ex, context)
7
- retry_count = (context['retry_count'] || (context['job'] && context['job']['retry_count']))
5
+ class MeteredRavenErrorHandler < ::Raven::SidekiqErrorHandler
6
+ def call(ex, original_context)
7
+ ::Rails.logger.debug("MeteredRavenErrorHandler -- Error on Sidekiq job. Exception: #{ex.inspect} - Context: #{original_context.inspect}")
8
8
 
9
- if retry_count.nil? || retry_count > 1
10
- super(ex, context)
9
+ # symbolize keys so we don't have to worry about strings vs. symbols
10
+ context = original_context.deep_symbolize_keys
11
+
12
+ # If the job context has a `retry_count` key, it tells us how many times the job has been REtried so far.
13
+ # If it lacks this key, it has never been retried; this is the first attempt.
14
+ retry_count = (context[:retry_count] || (context[:job] && context[:job][:retry_count])).try(:to_i) || 0
15
+
16
+ # Is this a retryable job?
17
+ is_retryable = context[:retry] || (context[:job] && context[:job][:retry])
18
+
19
+ # We notify if this job has been retried at least once.
20
+ # Someday we plan to make this number configurable.
21
+ # If this isn't a retryable job, we notify even if this is the first attempt, because there will not be more attempts.
22
+ if retry_count > 0 || !is_retryable
23
+ ::Rails.logger.debug("MeteredRavenErrorHandler -- Current retry count: #{retry_count}. Notifying upstream...")
24
+
25
+ super(ex, original_context)
11
26
  end
12
27
  end
13
28
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: sidekiq_metered_exceptions 0.2.1 ruby lib
5
+ # stub: sidekiq_metered_exceptions 0.3.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "sidekiq_metered_exceptions".freeze
9
- s.version = "0.2.1"
9
+ s.version = "0.3.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Nathan Woodhull".freeze]
14
- s.date = "2017-01-19"
14
+ s.date = "2018-06-12"
15
15
  s.description = "Some exceptions are transient, so notifying an admin is not useful.".freeze
16
16
  s.email = "woodhull@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  ]
37
37
  s.homepage = "http://github.com/woodhull/sidekiq_metered_exceptions".freeze
38
38
  s.licenses = ["MIT".freeze]
39
- s.rubygems_version = "2.6.8".freeze
39
+ s.rubygems_version = "2.6.12".freeze
40
40
  s.summary = "Only propagate sidekiq exceptions that have already been retried once.".freeze
41
41
 
42
42
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_metered_exceptions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.6.8
139
+ rubygems_version: 2.6.12
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Only propagate sidekiq exceptions that have already been retried once.