good_job 2.8.1 → 2.9.0
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 +12 -0
- data/lib/good_job/notifier.rb +9 -5
- 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: ba4a26a2047c0e7dd8b78264fee7c6d2c05c2dd59e38f1df402b698826b56288
|
4
|
+
data.tar.gz: 3bd4c49139941c2d37751abb9d32808b0efd7a33370aa7370afeed21cc845ab0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ade6a5c9b26e1d9d1bc1522dc10159f78943b5da249effa1405dccf5c3de5078f74a08c27657eef63d51967bb04eb8486d933e9d817664a25c33f3740f2280
|
7
|
+
data.tar.gz: 40dc9f0b3b1d210ddcec9d7ce5dd7014e2409d5602bb4b3c55314b5bf799ef29fab9fd0764931c2026242c91383a335b64c4f3243ea16d50997e59ef9c7820e3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v2.9.0](https://github.com/bensheldon/good_job/tree/v2.9.0) (2022-01-09)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.8.1...v2.9.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Add JRuby / JDBC support for LISTEN [\#479](https://github.com/bensheldon/good_job/pull/479) ([bensheldon](https://github.com/bensheldon))
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Remove demo CleanupJob in favor of using built-in cleanup intervals [\#478](https://github.com/bensheldon/good_job/pull/478) ([bensheldon](https://github.com/bensheldon))
|
14
|
+
|
3
15
|
## [v2.8.1](https://github.com/bensheldon/good_job/tree/v2.8.1) (2022-01-03)
|
4
16
|
|
5
17
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.8.0...v2.8.1)
|
data/lib/good_job/notifier.rb
CHANGED
@@ -16,9 +16,6 @@ module GoodJob # :nodoc:
|
|
16
16
|
|
17
17
|
include Notifier::ProcessRegistration
|
18
18
|
|
19
|
-
# Raised if the Database adapter does not implement LISTEN.
|
20
|
-
AdapterCannotListenError = Class.new(StandardError)
|
21
|
-
|
22
19
|
# Default Postgres channel for LISTEN/NOTIFY
|
23
20
|
CHANNEL = 'good_job'
|
24
21
|
# Defaults for instance of Concurrent::ThreadPoolExecutor
|
@@ -129,8 +126,6 @@ module GoodJob # :nodoc:
|
|
129
126
|
# @!visibility private
|
130
127
|
# @return [void]
|
131
128
|
def listen_observer(_time, _result, thread_error)
|
132
|
-
return if thread_error.is_a? AdapterCannotListenError
|
133
|
-
|
134
129
|
if thread_error
|
135
130
|
GoodJob._on_thread_error(thread_error)
|
136
131
|
ActiveSupport::Notifications.instrument("notifier_notify_error.good_job", { error: thread_error })
|
@@ -214,6 +209,15 @@ module GoodJob # :nodoc:
|
|
214
209
|
raw_connection.wait_for_notify(WAIT_INTERVAL) do |channel, _pid, payload|
|
215
210
|
yield(channel, payload)
|
216
211
|
end
|
212
|
+
elsif raw_connection.respond_to?(:jdbc_connection)
|
213
|
+
raw_connection.execute_query("SELECT 1")
|
214
|
+
notifications = raw_connection.jdbc_connection.getNotifications
|
215
|
+
Array(notifications).each do |notification|
|
216
|
+
channel = notification.getName
|
217
|
+
payload = notification.getParameter
|
218
|
+
yield(channel, payload)
|
219
|
+
end
|
220
|
+
sleep WAIT_INTERVAL
|
217
221
|
else
|
218
222
|
sleep WAIT_INTERVAL
|
219
223
|
end
|
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: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sheldon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|