good_job 2.8.1 → 2.9.0

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: bca3de7432f33744351456a803dcbb74f73c0228f824dad035b51565c711e529
4
- data.tar.gz: 0e0b3d2959f2db50c00d61a49ccad52be73711ac8e07cfd7cfffb186923fb5b2
3
+ metadata.gz: ba4a26a2047c0e7dd8b78264fee7c6d2c05c2dd59e38f1df402b698826b56288
4
+ data.tar.gz: 3bd4c49139941c2d37751abb9d32808b0efd7a33370aa7370afeed21cc845ab0
5
5
  SHA512:
6
- metadata.gz: ad760ae64fe74a08943013b9359e675bf46ad366cb9a688937a182e2fc8b6abd336fa8b8408cc61e22cf7c3ab713d0fa9e0a6ae973196d653e5c763818ef1672
7
- data.tar.gz: 630f2765587b5b675eaf1e33b6c5b39a83ada8980a0638011e2cc71f4ce963d6f6287db5d50a9c5efb3d1ba7c1402e7ef1f2beb11369ad981a6046c8e4491f30
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)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '2.8.1'
4
+ VERSION = '2.9.0'
5
5
  end
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.8.1
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-03 00:00:00.000000000 Z
11
+ date: 2022-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob