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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/sidekiq_publisher/report_unpublished_count.rb +12 -0
- data/lib/sidekiq_publisher/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fad335b6e2f541d0b15fb3ba8ca2094700636bf9db012acd1e90f1a6f25dcb8c
|
4
|
+
data.tar.gz: 8a27ea4780c067005505aef5871cf0adeccfe1559df8ce40149f6427a693d6d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 529af1f68db640954806bb7afb5331d744aaf81b4e076029becb365eabaa6e9eae905ab4bf60fd77cba00d6cd84b4096fb4e8f8686a0ada8bb4ddc17908bfb47
|
7
|
+
data.tar.gz: f62d7210ffd44cdfc9a428e2213255b30446e54199aea45b11d959295ef46bcfb04c3b13afe786e184cdd3c456be0f540ef48efde09b08072c58b083ac81e4c0
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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.
|
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-
|
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
|
-
|
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
|