good_job 2.4.1 → 2.6.1

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +84 -0
  3. data/README.md +12 -4
  4. data/engine/app/assets/scripts.js +1 -0
  5. data/engine/app/assets/style.css +5 -0
  6. data/engine/app/assets/vendor/chartjs/chart.min.js +13 -0
  7. data/engine/app/assets/vendor/rails_ujs.js +747 -0
  8. data/engine/app/charts/good_job/scheduled_by_queue_chart.rb +69 -0
  9. data/engine/app/controllers/good_job/assets_controller.rb +8 -4
  10. data/engine/app/controllers/good_job/cron_entries_controller.rb +19 -0
  11. data/engine/app/controllers/good_job/jobs_controller.rb +36 -0
  12. data/engine/app/filters/good_job/base_filter.rb +18 -56
  13. data/engine/app/filters/good_job/executions_filter.rb +9 -8
  14. data/engine/app/filters/good_job/jobs_filter.rb +12 -9
  15. data/engine/app/views/good_job/cron_entries/index.html.erb +51 -0
  16. data/engine/app/views/good_job/cron_entries/show.html.erb +4 -0
  17. data/engine/app/views/good_job/{shared/_executions_table.erb → executions/_table.erb} +1 -1
  18. data/engine/app/views/good_job/executions/index.html.erb +2 -2
  19. data/engine/app/views/good_job/{shared/_jobs_table.erb → jobs/_table.erb} +18 -6
  20. data/engine/app/views/good_job/jobs/index.html.erb +15 -2
  21. data/engine/app/views/good_job/jobs/show.html.erb +2 -2
  22. data/engine/app/views/good_job/shared/_chart.erb +19 -46
  23. data/engine/app/views/good_job/shared/_filter.erb +27 -13
  24. data/engine/app/views/good_job/shared/icons/_arrow_clockwise.html.erb +5 -0
  25. data/engine/app/views/good_job/shared/icons/_play.html.erb +4 -0
  26. data/engine/app/views/good_job/shared/icons/_skip_forward.html.erb +4 -0
  27. data/engine/app/views/good_job/shared/icons/_stop.html.erb +4 -0
  28. data/engine/app/views/layouts/good_job/base.html.erb +6 -4
  29. data/engine/config/routes.rb +17 -4
  30. data/lib/generators/good_job/install_generator.rb +6 -0
  31. data/lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb +3 -1
  32. data/lib/generators/good_job/templates/update/migrations/{01_create_good_jobs.rb → 01_create_good_jobs.rb.erb} +1 -1
  33. data/lib/generators/good_job/templates/update/migrations/02_add_cron_at_to_good_jobs.rb.erb +14 -0
  34. data/lib/generators/good_job/templates/update/migrations/03_add_cron_key_cron_at_index_to_good_jobs.rb.erb +20 -0
  35. data/lib/generators/good_job/update_generator.rb +6 -0
  36. data/lib/good_job/active_job_extensions/concurrency.rb +3 -4
  37. data/lib/good_job/active_job_job.rb +228 -0
  38. data/lib/good_job/configuration.rb +1 -1
  39. data/lib/good_job/cron_entry.rb +78 -5
  40. data/lib/good_job/cron_manager.rb +4 -6
  41. data/lib/good_job/current_thread.rb +38 -5
  42. data/lib/good_job/execution.rb +51 -43
  43. data/lib/good_job/filterable.rb +42 -0
  44. data/lib/good_job/lockable.rb +1 -1
  45. data/lib/good_job/notifier.rb +17 -7
  46. data/lib/good_job/version.rb +1 -1
  47. metadata +32 -22
  48. data/engine/app/assets/vendor/chartist/chartist.css +0 -613
  49. data/engine/app/assets/vendor/chartist/chartist.js +0 -4516
  50. data/engine/app/controllers/good_job/cron_schedules_controller.rb +0 -9
  51. data/engine/app/models/good_job/active_job_job.rb +0 -127
  52. data/engine/app/views/good_job/cron_schedules/index.html.erb +0 -72
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0546a16ecd5760e3ca0dd5097ec950767b5993ac613489d5591d5d44eadc021
4
- data.tar.gz: 9e21d8930806b1843d4c32abef233f89f48292229386da593ba82b3a94617eae
3
+ metadata.gz: 3a413bcbddac29378e8fb0de0cc9305b57bd2e31041973f5db2a9dac6f04b7b1
4
+ data.tar.gz: d99f0e37ad2c99ac0d69337fefccff11bc522ad370f02ae1ac12d59adab619d8
5
5
  SHA512:
6
- metadata.gz: 6e3aa1deaa9973f0d435bc6eb77e4557f509a5e9dbd38e267a4268987561576323eda9bfb8bfa3af5ad7aec72c51b17f88121f7d202b1455c1ea17c8272cb6de
7
- data.tar.gz: b812a3371f589db1464f3dabe35badee94bf2a8f132e68e64c438e8ddde4415598d133f2e956d335e021a0ea82b59fbc61c3eb77cab230be760516dbca270402
6
+ metadata.gz: 3d6cddf9581a852f72f4c8b337149afc7fc4d2189d6304e510f19ca101cb661c1452b3eca3a123e28750c9729d9f6ca9224855a020296f68693246104864eb4f
7
+ data.tar.gz: a042a1f1c29525e4c101b512f74a06cb4f2405a790d5e199e1dac87029e220b404d1b310683a151ef67ed7c50c8d94ae8e28c578b270175085d4c7e60f9040d3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.6.1](https://github.com/bensheldon/good_job/tree/v2.6.1) (2021-11-05)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.6.0...v2.6.1)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Allow job management \(retry, destroy\) through the Web UI [\#256](https://github.com/bensheldon/good_job/issues/256)
10
+ - Add fulltext search filter [\#440](https://github.com/bensheldon/good_job/pull/440) ([bensheldon](https://github.com/bensheldon))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Unsubscribed LISTEN forever after database connection lost [\#303](https://github.com/bensheldon/good_job/issues/303)
15
+ - Add `PG::UnableToSend` and `PG::Error` as a Notifier connection error [\#445](https://github.com/bensheldon/good_job/pull/445) ([bensheldon](https://github.com/bensheldon))
16
+
17
+ **Closed issues:**
18
+
19
+ - Question: what's the correct way to handle database connection pool size when using cron [\#443](https://github.com/bensheldon/good_job/issues/443)
20
+ - Add a search bar to Dashboard [\#432](https://github.com/bensheldon/good_job/issues/432)
21
+ - Hacktoberfest 2021 [\#393](https://github.com/bensheldon/good_job/issues/393)
22
+ - Ideas for improvements to Cron [\#392](https://github.com/bensheldon/good_job/issues/392)
23
+ - Fix flakey test that times out [\#382](https://github.com/bensheldon/good_job/issues/382)
24
+
25
+ **Merged pull requests:**
26
+
27
+ - Update development dependencies [\#447](https://github.com/bensheldon/good_job/pull/447) ([bensheldon](https://github.com/bensheldon))
28
+ - Replace Chartist.js with Chart.js [\#444](https://github.com/bensheldon/good_job/pull/444) ([bensheldon](https://github.com/bensheldon))
29
+ - Fix JRuby flake: "Scheduler\#create\_thread returns false if there are no threads available" [\#442](https://github.com/bensheldon/good_job/pull/442) ([bensheldon](https://github.com/bensheldon))
30
+
31
+ ## [v2.6.0](https://github.com/bensheldon/good_job/tree/v2.6.0) (2021-10-30)
32
+
33
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.5.0...v2.6.0)
34
+
35
+ **Implemented enhancements:**
36
+
37
+ - Allow for cron schedules to be expressed using fugit natural language parsing [\#441](https://github.com/bensheldon/good_job/pull/441) ([jgrau](https://github.com/jgrau))
38
+ - Add Rails UJS javascript to Dashboard along with confirmations [\#437](https://github.com/bensheldon/good_job/pull/437) ([bensheldon](https://github.com/bensheldon))
39
+ - Reorganize Cron dashboard screen; add jobs drill-drown and enqueue-now action [\#436](https://github.com/bensheldon/good_job/pull/436) ([bensheldon](https://github.com/bensheldon))
40
+
41
+ **Closed issues:**
42
+
43
+ - Ability to express cron schedule using fugit natural language parser [\#439](https://github.com/bensheldon/good_job/issues/439)
44
+ - Best way to ensure ordering of a queue. [\#402](https://github.com/bensheldon/good_job/issues/402)
45
+ - ActiveJob concurrency raises FrozenError [\#386](https://github.com/bensheldon/good_job/issues/386)
46
+
47
+ ## [v2.5.0](https://github.com/bensheldon/good_job/tree/v2.5.0) (2021-10-25)
48
+
49
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.4.2...v2.5.0)
50
+
51
+ **Implemented enhancements:**
52
+
53
+ - Add Reschedule, Discard, Retry Job buttons to Dashboard [\#425](https://github.com/bensheldon/good_job/pull/425) ([bensheldon](https://github.com/bensheldon))
54
+ - Use unique index on \[cron\_key, cron\_at\] columns to prevent duplicate cron jobs from being enqueued [\#423](https://github.com/bensheldon/good_job/pull/423) ([bensheldon](https://github.com/bensheldon))
55
+
56
+ **Fixed bugs:**
57
+
58
+ - Dashboard fix preservation of `limit` and `queue_name` filter params; add pager to jobs [\#434](https://github.com/bensheldon/good_job/pull/434) ([bensheldon](https://github.com/bensheldon))
59
+
60
+ **Closed issues:**
61
+
62
+ - PgLock state inspection is not isolated to current database [\#431](https://github.com/bensheldon/good_job/issues/431)
63
+ - Race condition with concurency control [\#378](https://github.com/bensheldon/good_job/issues/378)
64
+
65
+ **Merged pull requests:**
66
+
67
+ - Add Readme note about race conditions in Concurrency's `enqueue\_limit` and `perform\_limit [\#433](https://github.com/bensheldon/good_job/pull/433) ([bensheldon](https://github.com/bensheldon))
68
+ - Test harness should only force-unlock db connections for the current database [\#430](https://github.com/bensheldon/good_job/pull/430) ([bensheldon](https://github.com/bensheldon))
69
+
70
+ ## [v2.4.2](https://github.com/bensheldon/good_job/tree/v2.4.2) (2021-10-19)
71
+
72
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.4.1...v2.4.2)
73
+
74
+ **Implemented enhancements:**
75
+
76
+ - Add migration version to install/update generator templates [\#426](https://github.com/bensheldon/good_job/pull/426) ([bensheldon](https://github.com/bensheldon))
77
+
78
+ **Fixed bugs:**
79
+
80
+ - Explicitly unscope queries within block yielded to Lockable.within\_advisory\_lock [\#429](https://github.com/bensheldon/good_job/pull/429) ([bensheldon](https://github.com/bensheldon))
81
+ - Fix Demo CleanupJob args [\#427](https://github.com/bensheldon/good_job/pull/427) ([bensheldon](https://github.com/bensheldon))
82
+
83
+ **Merged pull requests:**
84
+
85
+ - Remove v1.99/v2 transitional extra advisory lock [\#428](https://github.com/bensheldon/good_job/pull/428) ([bensheldon](https://github.com/bensheldon))
86
+
3
87
  ## [v2.4.1](https://github.com/bensheldon/good_job/tree/v2.4.1) (2021-10-11)
4
88
 
5
89
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.4.0...v2.4.1)
data/README.md CHANGED
@@ -363,11 +363,19 @@ class MyJob < ApplicationJob
363
363
  total_limit: 1,
364
364
 
365
365
  # Or, if more control is needed:
366
- # Maximum number of jobs with the concurrency key to be concurrently enqueued (excludes performing jobs)
366
+ # Maximum number of jobs with the concurrency key to be
367
+ # concurrently enqueued (excludes performing jobs)
367
368
  enqueue_limit: 2,
368
- # Maximum number of jobs with the concurrency key to be concurrently performed (excludes enqueued jobs)
369
+
370
+ # Maximum number of jobs with the concurrency key to be
371
+ # concurrently performed (excludes enqueued jobs)
369
372
  perform_limit: 1,
370
373
 
374
+ # Note: Under heavy load, the total number of jobs may exceed the
375
+ # sum of `enqueue_limit` and `perform_limit` because of race conditions
376
+ # caused by imperfectly disjunctive states. If you need to constrain
377
+ # the total number of jobs, use `total_limit` instead. See #378.
378
+
371
379
  # A unique key to be globally locked against.
372
380
  # Can be String or Lambda/Proc that is invoked in the context of the job.
373
381
  # Note: Arguments passed to #perform_later must be accessed through `arguments` method.
@@ -391,9 +399,9 @@ job.good_job_concurrency_key #=> "Unique-Alice"
391
399
 
392
400
  GoodJob can enqueue jobs on a recurring basis that can be used as a replacement for cron.
393
401
 
394
- Cron-style jobs are run on every GoodJob process (e.g. CLI or `async` execution mode) when `config.good_job.enable_cron = true`; use GoodJob's [ActiveJob concurrency](#activejob-concurrency) extension to limit the number of jobs that are enqueued.
402
+ Cron-style jobs are run on every GoodJob process (e.g. CLI or `async` execution mode) when `config.good_job.enable_cron = true`, but GoodJob's cron uses unique indexes to ensure that only a single job is enqeued at the given time interval.
395
403
 
396
- Cron-format is parsed by the [`fugit`](https://github.com/floraison/fugit) gem, which has support for seconds-level resolution (e.g. `* * * * * *`).
404
+ Cron-format is parsed by the [`fugit`](https://github.com/floraison/fugit) gem, which has support for seconds-level resolution (e.g. `* * * * * *`) and natural language parsing (e.g. `every second`).
397
405
 
398
406
  ```ruby
399
407
  # config/environments/application.rb or a specific environment e.g. production.rb
@@ -0,0 +1 @@
1
+ GoodJob = {};
@@ -18,3 +18,8 @@
18
18
  .ct-label.ct-horizontal {
19
19
  white-space: nowrap;
20
20
  }
21
+
22
+ .chart-wrapper {
23
+ position: relative;
24
+ height: 200px;
25
+ }