good_job 1.11.1 → 1.11.2
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/CHANGELOG.md +18 -0
- data/lib/good_job/job.rb +1 -0
- data/lib/good_job/notifier.rb +11 -3
- data/lib/good_job/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d78c670393e4cddbedfe9512fdda95855709d830618cd63cfde7e724f26ce6c8
|
|
4
|
+
data.tar.gz: 494d3b0d6ec2b05d0bcc3386c14baca6071635647ed808a9b3543b5f1ebc4bfb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bef7307febc465eab519c44a214287d5203bf0a024d83e46160dbbaf94b3a0fcd1317fbe99e446d9b0f01fb2bc8845a6dfe722fb123020aab96fe31b0c189d71
|
|
7
|
+
data.tar.gz: 737c03b9ad35169c9db43070abca6f644816876217fd333831db568f43eca6738dd9327eb7a403eb901ab6643e06445ba7764453d3f9b05e9e7c1159f7ba0963
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v1.11.2](https://github.com/bensheldon/good_job/tree/v1.11.2) (2021-07-20)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v1.11.1...v1.11.2)
|
|
6
|
+
|
|
7
|
+
**Fixed bugs:**
|
|
8
|
+
|
|
9
|
+
- Notifier waits to retry listening when database is unavailable [\#301](https://github.com/bensheldon/good_job/pull/301) ([bensheldon](https://github.com/bensheldon))
|
|
10
|
+
|
|
11
|
+
**Closed issues:**
|
|
12
|
+
|
|
13
|
+
- Handle database connection drops [\#296](https://github.com/bensheldon/good_job/issues/296)
|
|
14
|
+
- Using the `async` worker results in `ActiveModel::UnknownAttributeError unknown attribute 'create_with_advisory_lock' for GoodJob::Job`. [\#290](https://github.com/bensheldon/good_job/issues/290)
|
|
15
|
+
|
|
16
|
+
**Merged pull requests:**
|
|
17
|
+
|
|
18
|
+
- Rename development and test databases to be `good_job` [\#300](https://github.com/bensheldon/good_job/pull/300) ([bensheldon](https://github.com/bensheldon))
|
|
19
|
+
- Move generators spec into top-level spec directory; update dependencies [\#299](https://github.com/bensheldon/good_job/pull/299) ([bensheldon](https://github.com/bensheldon))
|
|
20
|
+
|
|
3
21
|
## [v1.11.1](https://github.com/bensheldon/good_job/tree/v1.11.1) (2021-07-07)
|
|
4
22
|
|
|
5
23
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v1.11.0...v1.11.1)
|
data/lib/good_job/job.rb
CHANGED
data/lib/good_job/notifier.rb
CHANGED
|
@@ -24,6 +24,8 @@ module GoodJob # :nodoc:
|
|
|
24
24
|
max_queue: 1,
|
|
25
25
|
fallback_policy: :discard,
|
|
26
26
|
}.freeze
|
|
27
|
+
# Seconds to wait if database cannot be connected to
|
|
28
|
+
RECONNECT_INTERVAL = 5
|
|
27
29
|
# Seconds to block while LISTENing for a message
|
|
28
30
|
WAIT_INTERVAL = 1
|
|
29
31
|
|
|
@@ -114,7 +116,13 @@ module GoodJob # :nodoc:
|
|
|
114
116
|
ActiveSupport::Notifications.instrument("notifier_notify_error.good_job", { error: thread_error })
|
|
115
117
|
end
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
return if shutdown?
|
|
120
|
+
|
|
121
|
+
if thread_error.is_a?(ActiveRecord::ConnectionNotEstablished) || thread_error.is_a?(ActiveRecord::StatementInvalid)
|
|
122
|
+
listen(delay: RECONNECT_INTERVAL)
|
|
123
|
+
else
|
|
124
|
+
listen
|
|
125
|
+
end
|
|
118
126
|
end
|
|
119
127
|
|
|
120
128
|
private
|
|
@@ -125,8 +133,8 @@ module GoodJob # :nodoc:
|
|
|
125
133
|
@executor = Concurrent::ThreadPoolExecutor.new(EXECUTOR_OPTIONS)
|
|
126
134
|
end
|
|
127
135
|
|
|
128
|
-
def listen
|
|
129
|
-
future = Concurrent::
|
|
136
|
+
def listen(delay: 0)
|
|
137
|
+
future = Concurrent::ScheduledTask.new(delay, args: [@recipients, executor, @listening], executor: @executor) do |thr_recipients, thr_executor, thr_listening|
|
|
130
138
|
with_listen_connection do |conn|
|
|
131
139
|
ActiveSupport::Notifications.instrument("notifier_listen.good_job") do
|
|
132
140
|
conn.async_exec("LISTEN #{CHANNEL}").clear
|
data/lib/good_job/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: good_job
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.11.
|
|
4
|
+
version: 1.11.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Sheldon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-07-
|
|
11
|
+
date: 2021-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activejob
|