sidekiq_publisher 1.7.0 → 1.7.1

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: 91e1f28973451bbee0a4b0d099e417707d0413ba475c2f7530d07d34f9e74b1f
4
- data.tar.gz: a9dd797b6193ef3a183f318afcc7582c375c0b2d374eac688203ac3eb3cf3f48
3
+ metadata.gz: fad335b6e2f541d0b15fb3ba8ca2094700636bf9db012acd1e90f1a6f25dcb8c
4
+ data.tar.gz: 8a27ea4780c067005505aef5871cf0adeccfe1559df8ce40149f6427a693d6d9
5
5
  SHA512:
6
- metadata.gz: 434a5f016d1ab9a082c6d786d002a8b1bacac7cc3ed4832d60ffa47678f9e81112e7ff0bb8bd3002a50cba4a3c99ba803a7e2fdbbc93e9805008a6a04073228f
7
- data.tar.gz: 202cb6eaf93e710379917e421167ba8bc1a3dc40634404f83595e8f3519956ea03e177ffb5e92407cfa61ce49a11a9748bdc3571eb4684a20cdbd2eace5080bf
6
+ metadata.gz: 529af1f68db640954806bb7afb5331d744aaf81b4e076029becb365eabaa6e9eae905ab4bf60fd77cba00d6cd84b4096fb4e8f8686a0ada8bb4ddc17908bfb47
7
+ data.tar.gz: f62d7210ffd44cdfc9a428e2213255b30446e54199aea45b11d959295ef46bcfb04c3b13afe786e184cdd3c456be0f540ef48efde09b08072c58b083ac81e4c0
@@ -1,5 +1,8 @@
1
1
  # sidekiq_publisher
2
2
 
3
+ ## v1.7.1
4
+ - Gracefully handle database connection errors in ReportUnpublishedCount by attempting to reconnect.
5
+
3
6
  ## v1.7.0
4
7
  - Add instrumentation using `ActiveSupport::Notifications`.
5
8
  - Reimplement `metrics_reporter` and `exception_reporter` support using
@@ -1,10 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_record"
4
+ require "pg"
5
+
3
6
  module SidekiqPublisher
4
7
  module ReportUnpublishedCount
5
8
  def self.call(instrumenter: Instrumenter.new)
6
9
  instrumenter.instrument("unpublished.reporter",
7
10
  unpublished_count: SidekiqPublisher::Job.unpublished.count)
11
+ rescue ActiveRecord::StatementInvalid, PG::UnableToSend, PG::ConnectionBad => e
12
+ ActiveRecord::Base.clear_active_connections! if db_connection_error?(e)
13
+ raise
14
+ end
15
+
16
+ def self.db_connection_error?(error)
17
+ cause = error.is_a?(ActiveRecord::StatementInvalid) ? error.cause : error
18
+ cause.is_a?(PG::UnableToSend) || cause.is_a?(PG::ConnectionBad)
8
19
  end
20
+ private_class_method :db_connection_error?
9
21
  end
10
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPublisher
4
- VERSION = "1.7.0"
4
+ VERSION = "1.7.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
11
+ date: 2020-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -340,7 +340,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
340
  - !ruby/object:Gem::Version
341
341
  version: '0'
342
342
  requirements: []
343
- rubygems_version: 3.1.4
343
+ rubyforge_project:
344
+ rubygems_version: 2.7.6.2
344
345
  signing_key:
345
346
  specification_version: 4
346
347
  summary: Publisher for enqueuing jobs to Sidekiq