good_job 2.4.2 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +79 -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/templates/install/migrations/create_good_jobs.rb.erb +2 -0
  31. data/lib/generators/good_job/templates/update/migrations/02_add_cron_at_to_good_jobs.rb.erb +14 -0
  32. data/lib/generators/good_job/templates/update/migrations/03_add_cron_key_cron_at_index_to_good_jobs.rb.erb +20 -0
  33. data/lib/good_job/active_job_job.rb +228 -0
  34. data/lib/good_job/configuration.rb +1 -1
  35. data/lib/good_job/cron_entry.rb +78 -5
  36. data/lib/good_job/cron_manager.rb +4 -6
  37. data/lib/good_job/current_thread.rb +38 -5
  38. data/lib/good_job/execution.rb +53 -39
  39. data/lib/good_job/filterable.rb +42 -0
  40. data/lib/good_job/notifier.rb +17 -7
  41. data/lib/good_job/version.rb +1 -1
  42. metadata +31 -21
  43. data/engine/app/assets/vendor/chartist/chartist.css +0 -613
  44. data/engine/app/assets/vendor/chartist/chartist.js +0 -4516
  45. data/engine/app/controllers/good_job/cron_schedules_controller.rb +0 -9
  46. data/engine/app/models/good_job/active_job_job.rb +0 -127
  47. 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: f06b525450f56cf74ff31e06e11cbf3bf2ee7f20d753973e70ddb53d67eb48d1
4
- data.tar.gz: d25d2037ae03eaea0ff8bd4ca1dfa52ba6a57d3420e53b4be265dc7c0be580cb
3
+ metadata.gz: 6815620f600cf3f925daf7a5f13074f79ee26d7ab16b28b28c3be9e1ac2b9ac9
4
+ data.tar.gz: b7befdf977e9bebe94ac2707bea503c9e60e112045838885ee398a319026af9c
5
5
  SHA512:
6
- metadata.gz: 2f2be221d400f0dc7a1e7c2d262b717ecd9c88a5192771df2bd343d61e878cb777af7e067814e3e7c751aa28716c2bd487b4389ef4dbbea17cc2a6a0f23d0c9a
7
- data.tar.gz: abfd020a2203bb573c5e801e7f278214ebe996b6e63970ec60313fcb37a3b21cb901d4cf57cfd6739b7c247ea692ff7de012df3668d7c551d7ced78cc48b79e6
6
+ metadata.gz: ba25873794f78d9e7081a0ae387d4e2c8cf6de96eaa28859e7fe565d85261de57538680f00d172f6eadcb91c157c1d2f34d66df2a630e94440b55fdd1f8ded05
7
+ data.tar.gz: 76a0d3cd4b76758f72a81f99a04aff2ea50396828b7fa4c440a3d401c01fc4accfb9d821f333b3ff71d517be565f9f9376ad27da5742611ff1744bc70c7d2f16
data/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.6.2](https://github.com/bensheldon/good_job/tree/v2.6.2) (2021-11-05)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.6.1...v2.6.2)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Rename Filterable\#search to Filterable\#search\_text to avoid name collision [\#451](https://github.com/bensheldon/good_job/pull/451) ([bensheldon](https://github.com/bensheldon))
10
+
11
+ **Closed issues:**
12
+
13
+ - v2.6.1 is incompatible with gem thinking-sphinx [\#450](https://github.com/bensheldon/good_job/issues/450)
14
+
15
+ ## [v2.6.1](https://github.com/bensheldon/good_job/tree/v2.6.1) (2021-11-05)
16
+
17
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.6.0...v2.6.1)
18
+
19
+ **Implemented enhancements:**
20
+
21
+ - Allow job management \(retry, destroy\) through the Web UI [\#256](https://github.com/bensheldon/good_job/issues/256)
22
+ - Add fulltext search filter [\#440](https://github.com/bensheldon/good_job/pull/440) ([bensheldon](https://github.com/bensheldon))
23
+
24
+ **Fixed bugs:**
25
+
26
+ - Unsubscribed LISTEN forever after database connection lost [\#303](https://github.com/bensheldon/good_job/issues/303)
27
+ - 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))
28
+
29
+ **Closed issues:**
30
+
31
+ - Question: what's the correct way to handle database connection pool size when using cron [\#443](https://github.com/bensheldon/good_job/issues/443)
32
+ - Add a search bar to Dashboard [\#432](https://github.com/bensheldon/good_job/issues/432)
33
+ - Hacktoberfest 2021 [\#393](https://github.com/bensheldon/good_job/issues/393)
34
+ - Ideas for improvements to Cron [\#392](https://github.com/bensheldon/good_job/issues/392)
35
+ - Fix flakey test that times out [\#382](https://github.com/bensheldon/good_job/issues/382)
36
+
37
+ **Merged pull requests:**
38
+
39
+ - Update development dependencies [\#447](https://github.com/bensheldon/good_job/pull/447) ([bensheldon](https://github.com/bensheldon))
40
+ - Replace Chartist.js with Chart.js [\#444](https://github.com/bensheldon/good_job/pull/444) ([bensheldon](https://github.com/bensheldon))
41
+ - 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))
42
+
43
+ ## [v2.6.0](https://github.com/bensheldon/good_job/tree/v2.6.0) (2021-10-30)
44
+
45
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.5.0...v2.6.0)
46
+
47
+ **Implemented enhancements:**
48
+
49
+ - 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))
50
+ - Add Rails UJS javascript to Dashboard along with confirmations [\#437](https://github.com/bensheldon/good_job/pull/437) ([bensheldon](https://github.com/bensheldon))
51
+ - 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))
52
+
53
+ **Closed issues:**
54
+
55
+ - Ability to express cron schedule using fugit natural language parser [\#439](https://github.com/bensheldon/good_job/issues/439)
56
+ - Best way to ensure ordering of a queue. [\#402](https://github.com/bensheldon/good_job/issues/402)
57
+ - ActiveJob concurrency raises FrozenError [\#386](https://github.com/bensheldon/good_job/issues/386)
58
+
59
+ ## [v2.5.0](https://github.com/bensheldon/good_job/tree/v2.5.0) (2021-10-25)
60
+
61
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.4.2...v2.5.0)
62
+
63
+ **Implemented enhancements:**
64
+
65
+ - Add Reschedule, Discard, Retry Job buttons to Dashboard [\#425](https://github.com/bensheldon/good_job/pull/425) ([bensheldon](https://github.com/bensheldon))
66
+ - 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))
67
+
68
+ **Fixed bugs:**
69
+
70
+ - 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))
71
+
72
+ **Closed issues:**
73
+
74
+ - PgLock state inspection is not isolated to current database [\#431](https://github.com/bensheldon/good_job/issues/431)
75
+ - Race condition with concurency control [\#378](https://github.com/bensheldon/good_job/issues/378)
76
+
77
+ **Merged pull requests:**
78
+
79
+ - 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))
80
+ - 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))
81
+
3
82
  ## [v2.4.2](https://github.com/bensheldon/good_job/tree/v2.4.2) (2021-10-19)
4
83
 
5
84
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v2.4.1...v2.4.2)
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
+ }