good_job 2.11.0 → 2.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -5
- data/README.md +39 -18
- data/engine/app/assets/scripts.js +3 -3
- data/engine/app/assets/style.css +5 -0
- data/engine/app/charts/good_job/scheduled_by_queue_chart.rb +2 -1
- data/engine/app/filters/good_job/jobs_filter.rb +2 -2
- data/lib/good_job/active_job_job.rb +8 -1
- data/lib/good_job/cli.rb +5 -5
- data/lib/good_job/cron_entry.rb +11 -1
- 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: 1c804e28bcaae78b4af5a654da6cacd9fba979159fb57cbbcfb4bcb348b947fa
|
4
|
+
data.tar.gz: cbd920c5050bcf5da2e328a3aa5c3bb638b5a077a3f67e6dbbf76202a38ec723
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef26c910377e43dc66facdb2ccbde95ace6b38c8a1a6672100496919573f3ce07f0e59cd68ee22f195f72590313ff66757086123be3beee07f0801ecf258bf8
|
7
|
+
data.tar.gz: ee5553f45df7ea0bb4eb7abb870a879556292a7b25247db8d40700347f639b98bfdc758105588a8059a07ac4d7a5d7ccc6e0ba5543daf5cae4e035431f021174
|
data/CHANGELOG.md
CHANGED
@@ -1,23 +1,74 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v2.11.3](https://github.com/bensheldon/good_job/tree/v2.11.3) (2022-03-30)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.11.2...v2.11.3)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Add explicit `kwargs:` key to cron configuration [\#548](https://github.com/bensheldon/good_job/pull/548) ([bensheldon](https://github.com/bensheldon))
|
10
|
+
|
11
|
+
**Closed issues:**
|
12
|
+
|
13
|
+
- ArgumentError: wrong number of arguments \(given 1, expected 0; required keyword: schedule\) - cron [\#546](https://github.com/bensheldon/good_job/issues/546)
|
14
|
+
- How to run clean up preserved jobs in cron? [\#541](https://github.com/bensheldon/good_job/issues/541)
|
15
|
+
- Erroring with "Too many open files" when good\_job tries reconnecting to database [\#530](https://github.com/bensheldon/good_job/issues/530)
|
16
|
+
- Can't cast Array [\#529](https://github.com/bensheldon/good_job/issues/529)
|
17
|
+
|
18
|
+
**Merged pull requests:**
|
19
|
+
|
20
|
+
- Use bundle add instead [\#542](https://github.com/bensheldon/good_job/pull/542) ([glaucocustodio](https://github.com/glaucocustodio))
|
21
|
+
- Update Readme to better explain queues, pools, threads, and database connections; update CLI to frontload queue option [\#539](https://github.com/bensheldon/good_job/pull/539) ([bensheldon](https://github.com/bensheldon))
|
22
|
+
|
23
|
+
## [v2.11.2](https://github.com/bensheldon/good_job/tree/v2.11.2) (2022-03-03)
|
24
|
+
|
25
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.11.1...v2.11.2)
|
26
|
+
|
27
|
+
**Closed issues:**
|
28
|
+
|
29
|
+
- Best practices in deploying and monitoring a queue [\#523](https://github.com/bensheldon/good_job/issues/523)
|
30
|
+
|
31
|
+
**Merged pull requests:**
|
32
|
+
|
33
|
+
- Wrap Rspec before and example blocks with a mutex for JRuby [\#537](https://github.com/bensheldon/good_job/pull/537) ([bensheldon](https://github.com/bensheldon))
|
34
|
+
- Delegate `ActiveJobJob.table_name` to `Execution` and prevent it from being directly assignable [\#536](https://github.com/bensheldon/good_job/pull/536) ([bensheldon](https://github.com/bensheldon))
|
35
|
+
- Enable DB table names customization [\#535](https://github.com/bensheldon/good_job/pull/535) ([dimvic](https://github.com/dimvic))
|
36
|
+
- Added a chapter on how to prepare for production. [\#525](https://github.com/bensheldon/good_job/pull/525) ([stas](https://github.com/stas))
|
37
|
+
|
38
|
+
## [v2.11.1](https://github.com/bensheldon/good_job/tree/v2.11.1) (2022-03-01)
|
39
|
+
|
40
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.11.0...v2.11.1)
|
41
|
+
|
42
|
+
**Fixed bugs:**
|
43
|
+
|
44
|
+
- Ensure sticky footer doesn't overlap paginater; fix polling interval to 30 seconds, not ms [\#534](https://github.com/bensheldon/good_job/pull/534) ([bensheldon](https://github.com/bensheldon))
|
45
|
+
|
46
|
+
**Closed issues:**
|
47
|
+
|
48
|
+
- Pagination buttons hidden behind footer [\#533](https://github.com/bensheldon/good_job/issues/533)
|
49
|
+
|
3
50
|
## [v2.11.0](https://github.com/bensheldon/good_job/tree/v2.11.0) (2022-02-27)
|
4
51
|
|
5
52
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.10.0...v2.11.0)
|
6
53
|
|
54
|
+
**Implemented enhancements:**
|
55
|
+
|
56
|
+
- Add support for live polling the dashboard [\#528](https://github.com/bensheldon/good_job/pull/528) ([danielwestendorf](https://github.com/danielwestendorf))
|
57
|
+
|
7
58
|
**Closed issues:**
|
8
59
|
|
9
60
|
- How do I ensure that a the same job can't run twice? \(unique job / avoid duplicates\) [\#531](https://github.com/bensheldon/good_job/issues/531)
|
10
61
|
- Bulk reschedule and discard jobs via dashboard [\#527](https://github.com/bensheldon/good_job/issues/527)
|
11
62
|
- "Live Poll" dashboard [\#526](https://github.com/bensheldon/good_job/issues/526)
|
12
63
|
|
13
|
-
**Merged pull requests:**
|
14
|
-
|
15
|
-
- Add support for live polling the dashboard [\#528](https://github.com/bensheldon/good_job/pull/528) ([danielwestendorf](https://github.com/danielwestendorf))
|
16
|
-
|
17
64
|
## [v2.10.0](https://github.com/bensheldon/good_job/tree/v2.10.0) (2022-02-18)
|
18
65
|
|
19
66
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v2.9.6...v2.10.0)
|
20
67
|
|
68
|
+
**Implemented enhancements:**
|
69
|
+
|
70
|
+
- Dashboard: update search filters and some small UI updates [\#518](https://github.com/bensheldon/good_job/pull/518) ([multiplegeorges](https://github.com/multiplegeorges))
|
71
|
+
|
21
72
|
**Closed issues:**
|
22
73
|
|
23
74
|
- Cron jobs not getting run [\#519](https://github.com/bensheldon/good_job/issues/519)
|
@@ -29,7 +80,6 @@
|
|
29
80
|
- Fix Benchmark job throughput script [\#522](https://github.com/bensheldon/good_job/pull/522) ([douglara](https://github.com/douglara))
|
30
81
|
- Update development Gemfile.lock [\#521](https://github.com/bensheldon/good_job/pull/521) ([bensheldon](https://github.com/bensheldon))
|
31
82
|
- Ensure Rails 6.0 is tested against Ruby 3.0; use Ruby 3.0 in demo environment [\#520](https://github.com/bensheldon/good_job/pull/520) ([bensheldon](https://github.com/bensheldon))
|
32
|
-
- Dashboard: update search filters and some small UI updates [\#518](https://github.com/bensheldon/good_job/pull/518) ([multiplegeorges](https://github.com/multiplegeorges))
|
33
83
|
- Document safer setting for retry\_on\_unhandled\_error [\#517](https://github.com/bensheldon/good_job/pull/517) ([tamaloa](https://github.com/tamaloa))
|
34
84
|
|
35
85
|
## [v2.9.6](https://github.com/bensheldon/good_job/tree/v2.9.6) (2022-02-07)
|
data/README.md
CHANGED
@@ -52,6 +52,7 @@ For more of the story of GoodJob, read the [introductory blog post](https://isla
|
|
52
52
|
- [Timeouts](#timeouts)
|
53
53
|
- [Optimize queues, threads, and processes](#optimize-queues-threads-and-processes)
|
54
54
|
- [Database connections](#database-connections)
|
55
|
+
- [Production setup](#production-setup)
|
55
56
|
- [Execute jobs async / in-process](#execute-jobs-async--in-process)
|
56
57
|
- [Migrate to GoodJob from a different ActiveJob backend](#migrate-to-goodjob-from-a-different-activejob-backend)
|
57
58
|
- [Monitor and preserve worked jobs](#monitor-and-preserve-worked-jobs)
|
@@ -64,16 +65,10 @@ For more of the story of GoodJob, read the [introductory blog post](https://isla
|
|
64
65
|
|
65
66
|
## Set up
|
66
67
|
|
67
|
-
1. Add `good_job` to your application's Gemfile:
|
68
|
+
1. Add `good_job` to your application's Gemfile and install the gem:
|
68
69
|
|
69
|
-
```
|
70
|
-
|
71
|
-
```
|
72
|
-
|
73
|
-
1. Install the gem:
|
74
|
-
|
75
|
-
```bash
|
76
|
-
bundle install
|
70
|
+
```sh
|
71
|
+
bundle add good_job
|
77
72
|
```
|
78
73
|
|
79
74
|
1. Run the GoodJob install generator. This will generate a database migration to create a table for GoodJob's job records:
|
@@ -164,8 +159,8 @@ Usage:
|
|
164
159
|
good_job start
|
165
160
|
|
166
161
|
Options:
|
167
|
-
[--
|
168
|
-
[--
|
162
|
+
[--queues=QUEUE_LIST] # Queues or pools to work from. (env var: GOOD_JOB_QUEUES, default: *)
|
163
|
+
[--max-threads=COUNT] # Default number of threads per pool to use for working jobs. (env var: GOOD_JOB_MAX_THREADS, default: 5)
|
169
164
|
[--poll-interval=SECONDS] # Interval between polls for available jobs in seconds (env var: GOOD_JOB_POLL_INTERVAL, default: 1)
|
170
165
|
[--max-cache=COUNT] # Maximum number of scheduled jobs to cache in memory (env var: GOOD_JOB_MAX_CACHE, default: 10000)
|
171
166
|
[--shutdown-timeout=SECONDS] # Number of seconds to wait for jobs to finish when shutting down before stopping the thread. (env var: GOOD_JOB_SHUTDOWN_TIMEOUT, default: -1 (forever))
|
@@ -229,12 +224,12 @@ Rails.application.configure do
|
|
229
224
|
config.good_job.retry_on_unhandled_error = false
|
230
225
|
config.good_job.on_thread_error = -> (exception) { Raven.capture_exception(exception) }
|
231
226
|
config.good_job.execution_mode = :async
|
227
|
+
config.good_job.queues = '*'
|
232
228
|
config.good_job.max_threads = 5
|
233
229
|
config.good_job.poll_interval = 30 # seconds
|
234
230
|
config.good_job.shutdown_timeout = 25 # seconds
|
235
231
|
config.good_job.enable_cron = true
|
236
232
|
config.good_job.cron = { example: { cron: '0 * * * *', class: 'ExampleJob' } }
|
237
|
-
config.good_job.queues = '*'
|
238
233
|
|
239
234
|
# ...or all at once.
|
240
235
|
config.good_job = {
|
@@ -242,6 +237,7 @@ Rails.application.configure do
|
|
242
237
|
retry_on_unhandled_error: false,
|
243
238
|
on_thread_error: -> (exception) { Raven.capture_exception(exception) },
|
244
239
|
execution_mode: :async,
|
240
|
+
queues: '*',
|
245
241
|
max_threads: 5,
|
246
242
|
poll_interval: 30,
|
247
243
|
shutdown_timeout: 25,
|
@@ -252,7 +248,6 @@ Rails.application.configure do
|
|
252
248
|
class: 'ExampleJob'
|
253
249
|
},
|
254
250
|
},
|
255
|
-
queues: '*',
|
256
251
|
}
|
257
252
|
end
|
258
253
|
```
|
@@ -264,8 +259,8 @@ Available configuration options are:
|
|
264
259
|
- `:external` causes the adapter to enqueue jobs, but not execute them. When using this option (the default for production environments), you’ll need to use the command-line tool to actually execute your jobs.
|
265
260
|
- `:async` (or `:async_server`) executes jobs in separate threads within the Rails web server process (`bundle exec rails server`). It can be more economical for small workloads because you don’t need a separate machine or environment for running your jobs, but if your web server is under heavy load or your jobs require a lot of resources, you should choose `:external` instead. When not in the Rails web server, jobs will execute in `:external` mode to ensure jobs are not executed within `rails console`, `rails db:migrate`, `rails assets:prepare`, etc.
|
266
261
|
- `:async_all` executes jobs in separate threads in _any_ Rails process.
|
267
|
-
- `
|
268
|
-
- `
|
262
|
+
- `queues` (string) sets queues or pools to execute jobs. You can also set this with the environment variable `GOOD_JOB_QUEUES`.
|
263
|
+
- `max_threads` (integer) sets the default number of threads per pool to use for working jobs. You can also set this with the environment variable `GOOD_JOB_MAX_THREADS`.
|
269
264
|
- `poll_interval` (integer) sets the number of seconds between polls for jobs when `execution_mode` is set to `:async`. You can also set this with the environment variable `GOOD_JOB_POLL_INTERVAL`. A poll interval of `-1` disables polling completely.
|
270
265
|
- `max_cache` (integer) sets the maximum number of scheduled jobs that will be stored in memory to reduce execution latency when also polling for scheduled jobs. Caching 10,000 scheduled jobs uses approximately 20MB of memory. You can also set this with the environment variable `GOOD_JOB_MAX_CACHE`.
|
271
266
|
- `shutdown_timeout` (float) number of seconds to wait for jobs to finish when shutting down before stopping the thread. Defaults to forever: `-1`. You can also set this with the environment variable `GOOD_JOB_SHUTDOWN_TIMEOUT`.
|
@@ -441,7 +436,8 @@ config.good_job.cron = {
|
|
441
436
|
frequent_task: { # each recurring job must have a unique key
|
442
437
|
cron: "*/15 * * * *", # cron-style scheduling format by fugit gem
|
443
438
|
class: "ExampleJob", # reference the Job class with a string
|
444
|
-
args: [42,
|
439
|
+
args: [42, "life"], # positional arguments to pass; can also be a proc e.g. `-> { [Time.now] }`
|
440
|
+
kwargs: { name: "Alice" }, # keyword arguments to pass; can also be a proc e.g. `-> { { name: NAMES.sample } }`
|
445
441
|
set: { priority: -10 }, # additional ActiveJob properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }`
|
446
442
|
description: "Something helpful", # optional description that appears in Dashboard (coming soon!)
|
447
443
|
},
|
@@ -674,13 +670,38 @@ Keep in mind, queue operations and management is an advanced discipline. This st
|
|
674
670
|
|
675
671
|
### Database connections
|
676
672
|
|
677
|
-
Each GoodJob execution thread requires its own database connection that is automatically checked out from Rails’ connection pool.
|
673
|
+
Each GoodJob execution thread requires its own database connection that is automatically checked out from Rails’ connection pool. For example:
|
678
674
|
|
679
675
|
```yaml
|
680
676
|
# config/database.yml
|
681
|
-
pool: <%=
|
677
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5).to_i + 3 + (ENV.fetch("GOOD_JOB_MAX_THREADS", 5).to_i %>
|
682
678
|
```
|
683
679
|
|
680
|
+
To calculate the total number of the database connections you'll need:
|
681
|
+
|
682
|
+
- 1 connection dedicated to the scheduler aka `LISTEN/NOTIFY`
|
683
|
+
- 1 connection per query pool thread e.g. `--queues=mice:2;elephants:1` is 3 threads. Pool thread size defaults to `--max-threads`
|
684
|
+
- (optional) 2 connections for Cron scheduler if you're running it
|
685
|
+
- (optional) 1 connection per subthread, if your application makes multithreaded database queries within a job
|
686
|
+
- When running `:async`, you must also add the number of threads by the webserver
|
687
|
+
|
688
|
+
The queue process will not crash if the connections pool is exhausted, instead it will report an exception (eg. `ActiveRecord::ConnectionTimeoutError`).
|
689
|
+
|
690
|
+
#### Production setup
|
691
|
+
|
692
|
+
When running GoodJob in a production environment, you should be mindful of:
|
693
|
+
|
694
|
+
- [Execution mode](execute-jobs-async--in-process)
|
695
|
+
- [Database connection pool size](#database-connections)
|
696
|
+
- [Health check probes](#cli-http-health-check-probes) and potentially the [instrumentation support](#monitor-and-preserve-worked-jobs)
|
697
|
+
|
698
|
+
The recommended way to monitor the queue in production is:
|
699
|
+
|
700
|
+
- have an exception notifier callback (see `on_thread_error`)
|
701
|
+
- if possible, run the queue as a dedicated instance and use available HTTP health check probes instead of pid-based monitoring
|
702
|
+
- keep an eye on the number of jobs in the queue (abnormal high number of unscheduled jobs means the queue could be underperforming)
|
703
|
+
- consider performance monitoring services which support the built-in Rails instrumentation (eg. Sentry, Skylight, etc.)
|
704
|
+
|
684
705
|
### Execute jobs async / in-process
|
685
706
|
|
686
707
|
GoodJob can execute jobs "async" in the same process as the web server (e.g. `bin/rails s`). GoodJob's async execution mode offers benefits of economy by not requiring a separate job worker process, but with the tradeoff of increased complexity. Async mode can be configured in two ways:
|
@@ -37,13 +37,13 @@ const GoodJob = {
|
|
37
37
|
// live poll interval and enablement
|
38
38
|
if (urlParams.has('poll')) {
|
39
39
|
const parsedInterval = (parseInt(urlParams.get('poll')) || GOOD_JOB_DEFAULT_POLL_INTERVAL_SECONDS) * 1000;
|
40
|
-
|
41
|
-
GoodJob.pollEnabled = true;
|
42
40
|
GoodJob.pollInterval = Math.max(parsedInterval, GOOD_JOB_MINIMUM_POLL_INTERVAL);
|
43
41
|
GoodJob.setStorage('pollInterval', GoodJob.pollInterval);
|
42
|
+
|
43
|
+
GoodJob.pollEnabled = true;
|
44
44
|
} else {
|
45
|
+
GoodJob.pollInterval = GoodJob.getStorage('pollInterval') || (GOOD_JOB_DEFAULT_POLL_INTERVAL_SECONDS * 1000);
|
45
46
|
GoodJob.pollEnabled = GoodJob.getStorage('pollEnabled') || false;
|
46
|
-
GoodJob.pollInterval = GoodJob.getStorage('pollInterval') || GOOD_JOB_DEFAULT_POLL_INTERVAL_SECONDS;
|
47
47
|
}
|
48
48
|
|
49
49
|
document.getElementById('toggle-poll').checked = GoodJob.pollEnabled;
|
data/engine/app/assets/style.css
CHANGED
@@ -9,6 +9,7 @@ module GoodJob
|
|
9
9
|
def data
|
10
10
|
end_time = Time.current
|
11
11
|
start_time = end_time - 1.day
|
12
|
+
table_name = GoodJob::ActiveJobJob.table_name
|
12
13
|
|
13
14
|
count_query = Arel.sql(GoodJob::Execution.pg_or_jdbc_query(<<~SQL.squish))
|
14
15
|
SELECT *
|
@@ -23,7 +24,7 @@ module GoodJob
|
|
23
24
|
queue_name,
|
24
25
|
count(*) AS count
|
25
26
|
FROM (
|
26
|
-
#{@filter.filtered_query.except(:select, :order).select('queue_name',
|
27
|
+
#{@filter.filtered_query.except(:select, :order).select('queue_name', "COALESCE(#{table_name}.scheduled_at, #{table_name}.created_at)::timestamp AS scheduled_at").to_sql}
|
27
28
|
) sources
|
28
29
|
GROUP BY date_trunc('hour', scheduled_at), queue_name
|
29
30
|
) sources ON sources.scheduled_at = timestamp
|
@@ -14,7 +14,7 @@ module GoodJob
|
|
14
14
|
|
15
15
|
def filtered_query
|
16
16
|
query = base_query.includes(:executions)
|
17
|
-
.joins_advisory_locks.select(
|
17
|
+
.joins_advisory_locks.select("#{GoodJob::ActiveJobJob.table_name}.*", 'pg_locks.locktype AS locktype')
|
18
18
|
|
19
19
|
query = query.job_class(params[:job_class]) if params[:job_class].present?
|
20
20
|
query = query.where(queue_name: params[:queue_name]) if params[:queue_name].present?
|
@@ -31,7 +31,7 @@ module GoodJob
|
|
31
31
|
when 'scheduled'
|
32
32
|
query = query.scheduled
|
33
33
|
when 'running'
|
34
|
-
query = query.running.select(
|
34
|
+
query = query.running.select("#{GoodJob::ActiveJobJob.table_name}.*", 'pg_locks.locktype')
|
35
35
|
when 'queued'
|
36
36
|
query = query.queued
|
37
37
|
end
|
@@ -15,7 +15,14 @@ module GoodJob
|
|
15
15
|
# Attached to a Job's Execution when the Job is discarded.
|
16
16
|
DiscardJobError = Class.new(StandardError)
|
17
17
|
|
18
|
-
|
18
|
+
class << self
|
19
|
+
delegate :table_name, to: Execution
|
20
|
+
|
21
|
+
def table_name=(_value)
|
22
|
+
raise NotImplementedError, 'Assign GoodJob::Execution.table_name directly'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
19
26
|
self.primary_key = 'active_job_id'
|
20
27
|
self.advisory_lockable_column = 'active_job_id'
|
21
28
|
|
data/lib/good_job/cli.rb
CHANGED
@@ -50,14 +50,14 @@ module GoodJob
|
|
50
50
|
separate isolated execution pools with semicolons and threads with colons.
|
51
51
|
|
52
52
|
DESCRIPTION
|
53
|
-
method_option :max_threads,
|
54
|
-
type: :numeric,
|
55
|
-
banner: 'COUNT',
|
56
|
-
desc: "Maximum number of threads to use for working jobs. (env var: GOOD_JOB_MAX_THREADS, default: 5)"
|
57
53
|
method_option :queues,
|
58
54
|
type: :string,
|
59
55
|
banner: "QUEUE_LIST",
|
60
|
-
desc: "Queues to work from. (env var: GOOD_JOB_QUEUES, default: *)"
|
56
|
+
desc: "Queues or queue pools to work from. (env var: GOOD_JOB_QUEUES, default: *)"
|
57
|
+
method_option :max_threads,
|
58
|
+
type: :numeric,
|
59
|
+
banner: 'COUNT',
|
60
|
+
desc: "Default number of threads per pool to use for working jobs. (env var: GOOD_JOB_MAX_THREADS, default: 5)"
|
61
61
|
method_option :poll_interval,
|
62
62
|
type: :numeric,
|
63
63
|
banner: 'SECONDS',
|
data/lib/good_job/cron_entry.rb
CHANGED
@@ -52,6 +52,10 @@ module GoodJob # :nodoc:
|
|
52
52
|
params[:args]
|
53
53
|
end
|
54
54
|
|
55
|
+
def kwargs
|
56
|
+
params[:kwargs]
|
57
|
+
end
|
58
|
+
|
55
59
|
def description
|
56
60
|
params[:description]
|
57
61
|
end
|
@@ -87,7 +91,8 @@ module GoodJob # :nodoc:
|
|
87
91
|
current_thread.cron_key = key
|
88
92
|
current_thread.cron_at = cron_at
|
89
93
|
|
90
|
-
job_class.constantize.set(set_value)
|
94
|
+
configured_job = job_class.constantize.set(set_value)
|
95
|
+
kwargs_value.present? ? configured_job.perform_later(*args_value, **kwargs_value) : configured_job.perform_later(*args_value)
|
91
96
|
end
|
92
97
|
rescue ActiveRecord::RecordNotUnique
|
93
98
|
false
|
@@ -124,6 +129,11 @@ module GoodJob # :nodoc:
|
|
124
129
|
value.respond_to?(:call) ? value.call : value
|
125
130
|
end
|
126
131
|
|
132
|
+
def kwargs_value
|
133
|
+
value = kwargs || nil
|
134
|
+
value.respond_to?(:call) ? value.call : value
|
135
|
+
end
|
136
|
+
|
127
137
|
def display_property(value)
|
128
138
|
case value
|
129
139
|
when NilClass
|
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.11.
|
4
|
+
version: 2.11.3
|
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-
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|