good_job 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +4 -4
- data/lib/good_job/cli.rb +1 -1
- data/lib/good_job/configuration.rb +14 -10
- 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: 79ee8980f9408a7e530f6dbc4037f742033e3dbe9919442f08e854314730ef31
|
4
|
+
data.tar.gz: bf17a0b7e1fe8cb4d4f7bdfd20b333e2f9e1ce67504e34a9195e1e0921827284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 955afa8f3f3a224afb58824525a1b230abecbdbfd395e4e31a8dad5498fb32618c77d1e3c70a1503a3228c8e8ea3bdfdb4dccb9238ff0554ad43005e325a64c5
|
7
|
+
data.tar.gz: '029ba620af1d42c78b5b0d61524ac5338f501383b7ed166ff559cff4f0505a81485bef07b8aa04179ab17ab9fa6fca96a84b2a61694e7da18832b365fde8e1a1'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v3.7.1](https://github.com/bensheldon/good_job/tree/v3.7.1) (2022-12-12)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.7.0...v3.7.1)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Fix disabling of interval cleanups [\#768](https://github.com/bensheldon/good_job/pull/768) ([zarqman](https://github.com/zarqman))
|
10
|
+
|
3
11
|
## [v3.7.0](https://github.com/bensheldon/good_job/tree/v3.7.0) (2022-12-10)
|
4
12
|
|
5
13
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.6.2...v3.7.0)
|
data/README.md
CHANGED
@@ -273,8 +273,8 @@ Available configuration options are:
|
|
273
273
|
- `cron` (hash) cron configuration. Defaults to `{}`. You can also set this as a JSON string with the environment variable `GOOD_JOB_CRON`
|
274
274
|
- `cleanup_discarded_jobs` (boolean) whether to destroy discarded jobs when cleaning up preserved jobs using the `$ good_job cleanup_preserved_jobs` CLI command or calling `GoodJob.cleanup_preserved_jobs`. Defaults to `true`. Can also be set with the environment variable `GOOD_JOB_CLEANUP_DISCARDED_JOBS`. _This configuration is only used when {GoodJob.preserve_job_records} is `true`._
|
275
275
|
- `cleanup_preserved_jobs_before_seconds_ago` (integer) number of seconds to preserve jobs when using the `$ good_job cleanup_preserved_jobs` CLI command or calling `GoodJob.cleanup_preserved_jobs`. Defaults to `1209600` (14 days). Can also be set with the environment variable `GOOD_JOB_CLEANUP_PRESERVED_JOBS_BEFORE_SECONDS_AGO`. _This configuration is only used when {GoodJob.preserve_job_records} is `true`._
|
276
|
-
- `cleanup_interval_jobs` (integer) Number of jobs a Scheduler will execute before cleaning up preserved jobs. Defaults to `1000`. Can also be set with the environment variable `GOOD_JOB_CLEANUP_INTERVAL_JOBS`.
|
277
|
-
- `cleanup_interval_seconds` (integer) Number of seconds a Scheduler will wait before cleaning up preserved jobs. Defaults to `600` (10 minutes). Can also be set with the environment variable `GOOD_JOB_CLEANUP_INTERVAL_SECONDS`.
|
276
|
+
- `cleanup_interval_jobs` (integer) Number of jobs a Scheduler will execute before cleaning up preserved jobs. Defaults to `1000`. Disable with `nil`. Can also be set with the environment variable `GOOD_JOB_CLEANUP_INTERVAL_JOBS`.
|
277
|
+
- `cleanup_interval_seconds` (integer) Number of seconds a Scheduler will wait before cleaning up preserved jobs. Defaults to `600` (10 minutes). Disable with `nil`. Can also be set with the environment variable `GOOD_JOB_CLEANUP_INTERVAL_SECONDS`.
|
278
278
|
- `inline_execution_respects_schedule` (boolean) Opt-in to future behavior of inline execution respecting scheduled jobs. Defaults to `false`.
|
279
279
|
- `logger` ([Rails Logger](https://api.rubyonrails.org/classes/ActiveSupport/Logger.html)) lets you set a custom logger for GoodJob. It should be an instance of a Rails `Logger` (Default: `Rails.logger`).
|
280
280
|
- `preserve_job_records` (boolean) keeps job records in your database even after jobs are completed. (Default: `true`)
|
@@ -926,9 +926,9 @@ config.good_job.preserve_job_records = false # defaults to true; can also be `fa
|
|
926
926
|
GoodJob will automatically delete preserved job records after 14 days. The retention period, as well as the frequency GoodJob checks for deletable records can be configured:
|
927
927
|
|
928
928
|
```ruby
|
929
|
-
config.good_job.cleanup_preserved_jobs_before_seconds_ago = 14.days
|
929
|
+
config.good_job.cleanup_preserved_jobs_before_seconds_ago = 14.days
|
930
930
|
config.good_job.cleanup_interval_jobs = 1_000 # Number of executed jobs between deletion sweeps.
|
931
|
-
config.good_job.cleanup_interval_seconds = 10.minutes
|
931
|
+
config.good_job.cleanup_interval_seconds = 10.minutes # Number of seconds between deletion sweeps.
|
932
932
|
```
|
933
933
|
|
934
934
|
It is also possible to manually trigger a cleanup of preserved job records:
|
data/lib/good_job/cli.rb
CHANGED
@@ -137,7 +137,7 @@ module GoodJob
|
|
137
137
|
method_option :before_seconds_ago,
|
138
138
|
type: :numeric,
|
139
139
|
banner: 'SECONDS',
|
140
|
-
desc: "Destroy records finished more than this many seconds ago (env var: GOOD_JOB_CLEANUP_PRESERVED_JOBS_BEFORE_SECONDS_AGO, default:
|
140
|
+
desc: "Destroy records finished more than this many seconds ago (env var: GOOD_JOB_CLEANUP_PRESERVED_JOBS_BEFORE_SECONDS_AGO, default: 1209600 (14 days))"
|
141
141
|
|
142
142
|
def cleanup_preserved_jobs
|
143
143
|
set_up_application!
|
@@ -244,22 +244,26 @@ module GoodJob
|
|
244
244
|
# Number of jobs a {Scheduler} will execute before automatically cleaning up preserved jobs.
|
245
245
|
# @return [Integer, nil]
|
246
246
|
def cleanup_interval_jobs
|
247
|
-
value = (
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
247
|
+
value = if rails_config.key?(:cleanup_interval_jobs)
|
248
|
+
rails_config[:cleanup_interval_jobs]
|
249
|
+
elsif env.key?('GOOD_JOB_CLEANUP_INTERVAL_JOBS')
|
250
|
+
env['GOOD_JOB_CLEANUP_INTERVAL_JOBS']
|
251
|
+
else
|
252
|
+
DEFAULT_CLEANUP_INTERVAL_JOBS
|
253
|
+
end
|
252
254
|
value.present? ? value.to_i : nil
|
253
255
|
end
|
254
256
|
|
255
257
|
# Number of seconds a {Scheduler} will wait before automatically cleaning up preserved jobs.
|
256
258
|
# @return [Integer, nil]
|
257
259
|
def cleanup_interval_seconds
|
258
|
-
value = (
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
260
|
+
value = if rails_config.key?(:cleanup_interval_seconds)
|
261
|
+
rails_config[:cleanup_interval_seconds]
|
262
|
+
elsif env.key?('GOOD_JOB_CLEANUP_INTERVAL_SECONDS')
|
263
|
+
env['GOOD_JOB_CLEANUP_INTERVAL_SECONDS']
|
264
|
+
else
|
265
|
+
DEFAULT_CLEANUP_INTERVAL_SECONDS
|
266
|
+
end
|
263
267
|
value.present? ? value.to_i : nil
|
264
268
|
end
|
265
269
|
|
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: 3.7.
|
4
|
+
version: 3.7.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-12-
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|