good_job 2.15.0 → 2.15.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: b978264b509be9bd83e1e5e67f291b2889deff86c8316f876ab9def8264a7dd0
4
- data.tar.gz: 9b4172f97c1c7406d3c51ec81f926adaca801baa004aed743a8cac757bb2ce86
3
+ metadata.gz: bef9bcf112b4c04ebbc2ebb05a6253bfafcf8d6b077ac177e2da7dc51beb2530
4
+ data.tar.gz: c5379f8a78edf855415b67f0879e65ad469eebf73c535576d572a0069ae7feff
5
5
  SHA512:
6
- metadata.gz: a2696f821699ea080d2b77bb7704192222e6347d1b2be7fcf7a5e049d7b8979ceea3f5236c165fb27bb17fa5f9d8c7d2e5bb863b9c7298de9efb892facb6bca7
7
- data.tar.gz: 0ab7a37d403e1bec9c0638835c903aff4a1168f33143c7c27acd87c07bf95a61c1475c3e61bea0a7590d167144761cc64b7bc81566746c854c2ae9698aa999fe
6
+ metadata.gz: 6f668a1496b0a5ef3b9c0a8d126fe4b6709bcabd1cb96466fe4c8530620dffeed9ac2c10ca103773bf2a7196441d8bc8981893a4f01c91bd5cddf318d08fbf05
7
+ data.tar.gz: 26f017289703d8017dd69183b425a602d1501e835b11c4552ecfca789ed43ee192d56aaed2c204ecc06343ac07908b19ad56b23d978a0cae5869a10236e75dbd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.15.1](https://github.com/bensheldon/good_job/tree/v2.15.1) (2022-05-24)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.15.0...v2.15.1)
6
+
7
+ **Closed issues:**
8
+
9
+ - dashboard/engine – i18n: Wrong translation scope [\#605](https://github.com/bensheldon/good_job/issues/605)
10
+ - Concurrency not properly putting jobs in the queue [\#603](https://github.com/bensheldon/good_job/issues/603)
11
+ - Some dashboard actions have a routing error [\#602](https://github.com/bensheldon/good_job/issues/602)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Fix/i18n status scopes [\#607](https://github.com/bensheldon/good_job/pull/607) ([Jay-Schneider](https://github.com/Jay-Schneider))
16
+ - Make "Live Polling" ToC entry clickable [\#606](https://github.com/bensheldon/good_job/pull/606) ([aried3r](https://github.com/aried3r))
17
+ - Update readme explaining Concurrency implementation and how to integrate Dashboard with API-only Rails apps [\#604](https://github.com/bensheldon/good_job/pull/604) ([bensheldon](https://github.com/bensheldon))
18
+
3
19
  ## [v2.15.0](https://github.com/bensheldon/good_job/tree/v2.15.0) (2022-05-18)
4
20
 
5
21
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.14.4...v2.15.0)
data/README.md CHANGED
@@ -39,7 +39,10 @@ For more of the story of GoodJob, read the [introductory blog post](https://isla
39
39
  - [Configuration options](#configuration-options)
40
40
  - [Global options](#global-options)
41
41
  - [Dashboard](#dashboard)
42
+ - [API-only Rails applications](#api-only-rails-applications)
43
+ - [Live Polling](#live-polling)
42
44
  - [ActiveJob concurrency](#activejob-concurrency)
45
+ - [How concurrency controls work](#how-concurrency-controls-work)
43
46
  - [Cron-style repeating/recurring jobs](#cron-style-repeatingrecurring-jobs)
44
47
  - [Updating](#updating)
45
48
  - [Upgrading minor versions](#upgrading-minor-versions)
@@ -368,6 +371,23 @@ GoodJob includes a Dashboard as a mountable `Rails::Engine`.
368
371
  end
369
372
  ```
370
373
 
374
+ #### API-only Rails applications
375
+
376
+ API-only Rails applications may not have all of the required Rack middleware for the GoodJob Dashboard to function. To re-add the middlware:
377
+
378
+ ```ruby
379
+ # config/application.rb
380
+ module MyApp
381
+ class Application < Rails::Application
382
+ #...
383
+ config.middleware.use Rack::MethodOverride
384
+ config.middleware.use ActionDispatch::Flash
385
+ config.middleware.use ActionDispatch::Cookies
386
+ config.middleware.use ActionDispatch::Session::CookieStore
387
+ end
388
+ end
389
+ ```
390
+
371
391
  #### Live Polling
372
392
 
373
393
  The Dashboard can be set to automatically refresh by checking "Live Poll" in the Dashboard header, or by setting `?poll=10` with the interval in seconds (default 30 seconds).
@@ -420,6 +440,13 @@ job = MyJob.perform_later("Alice")
420
440
  job.good_job_concurrency_key #=> "Unique-Alice"
421
441
  ```
422
442
 
443
+ #### How concurrency controls work
444
+
445
+ GoodJob's concurrency control strategy for `perform_limit` is "optimistic retry with an incremental backoff". The [code is readable](https://github.com/bensheldon/good_job/blob/main/lib/good_job/active_job_extensions/concurrency.rb).
446
+
447
+ - "Optimistic" meaning that the implementation's performance trade-off assumes that collisions are atypical (e.g. two users enqueue the same job at the same time) rather than regular (e.g. the system enqueues thousands of colliding jobs at the same time).
448
+ - "Retry with an incremental backoff" means that when `perform_limit` is exceeded, the job will raise a `GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError` which is caught by a `retry_on` handler which re-schedules the job to execute in the near future with an incremental backoff.
449
+
423
450
  ### Cron-style repeating/recurring jobs
424
451
 
425
452
  GoodJob can enqueue jobs on a recurring basis that can be used as a replacement for cron.
@@ -34,3 +34,8 @@
34
34
  .toast-container {
35
35
  z-index: 1;
36
36
  }
37
+
38
+ .translation_missing {
39
+ background-color: red;
40
+ color: white;
41
+ }
@@ -41,7 +41,7 @@ module GoodJob
41
41
  }.freeze
42
42
 
43
43
  def status_badge(status)
44
- content_tag :span, status_icon(status, class: "text-white") + t(status, scope: '.status'),
44
+ content_tag :span, status_icon(status, class: "text-white") + t(status, scope: 'good_job.status'),
45
45
  class: "badge rounded-pill bg-#{STATUS_COLOR.fetch(status)} d-inline-flex gap-2 ps-1 pe-3 align-items-center"
46
46
  end
47
47
 
@@ -10,7 +10,7 @@
10
10
  <% filter.states.each do |name, count| %>
11
11
  <li class="nav-item">
12
12
  <%= link_to url_for({state: name}), class: "nav-link #{"active" if params[:state] == name}" do %>
13
- <%= t(name, scope: '.status') %>
13
+ <%= t(name, scope: 'good_job.status') %>
14
14
  <span class="badge bg-primary rounded-pill <%= "bg-secondary" if count == 0 %>"><%= count %></span>
15
15
  <% end %>
16
16
  </li>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '2.15.0'
4
+ VERSION = '2.15.1'
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.15.0
4
+ version: 2.15.1
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-05-18 00:00:00.000000000 Z
11
+ date: 2022-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob