good_job 1.13.2 → 1.99.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +38 -8
- data/lib/good_job/job.rb +7 -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: fe59c2b49eaef9a76ecbf1af80c6ea765fb89a5d61f01b0436595e15e377019e
|
4
|
+
data.tar.gz: 15c0ee082903f8316de7656e855489492a00e90b3e75e55475f59824b49c0542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22c7de0952050994cb220cda916ce85187775d2b79692b8ee094a0e6e76f84945ad528327fc3e83e50263e46272094949d2d6270a0332c19e8f79fb0841e0d80
|
7
|
+
data.tar.gz: '0229a23385ed171a50a39d54ab5295a5147110d203e84518643caa49c2dab16eee16263b54c86245a376e946402e9d39d52f05c3cde6ba2906f8f32fd77046e0'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v1.99.0](https://github.com/bensheldon/good_job/tree/v1.99.0) (2021-08-24)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v1.13.2...v1.99.0)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Set Advisory Lock on ActiveJob job uuid instead of GoodJob's job uuid [\#272](https://github.com/bensheldon/good_job/issues/272)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Add upgrade instructions for v1 to v2 [\#345](https://github.com/bensheldon/good_job/pull/345) ([bensheldon](https://github.com/bensheldon))
|
14
|
+
- Add transitional/temporary additional lock on good\_jobs-\[active\_job\_id\] [\#336](https://github.com/bensheldon/good_job/pull/336) ([bensheldon](https://github.com/bensheldon))
|
15
|
+
|
3
16
|
## [v1.13.2](https://github.com/bensheldon/good_job/tree/v1.13.2) (2021-08-18)
|
4
17
|
|
5
18
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v1.13.1...v1.13.2)
|
data/README.md
CHANGED
@@ -41,6 +41,8 @@ For more of the story of GoodJob, read the [introductory blog post](https://isla
|
|
41
41
|
- [ActiveJob concurrency](#activejob-concurrency)
|
42
42
|
- [Cron-style repeating/recurring jobs](#cron-style-repeatingrecurring-jobs)
|
43
43
|
- [Updating](#updating)
|
44
|
+
- [Upgrading minor versions](#upgrading-minor-versions)
|
45
|
+
- [Upgrading v1 to v2](#upgrading-v1-to-v2)
|
44
46
|
- [Go deeper](#go-deeper)
|
45
47
|
- [Exceptions, retries, and reliability](#exceptions-retries-and-reliability)
|
46
48
|
- [Exceptions](#exceptions)
|
@@ -405,17 +407,45 @@ config.good_job.cron = {
|
|
405
407
|
|
406
408
|
GoodJob follows semantic versioning, though updates may be encouraged through deprecation warnings in minor versions.
|
407
409
|
|
408
|
-
|
410
|
+
#### Upgrading minor versions
|
409
411
|
|
410
|
-
|
411
|
-
bin/rails g good_job:update
|
412
|
-
```
|
412
|
+
Upgrading between minor versions (e.g. v1.4 to v1.5) should not introduce breaking changes, but can introduce new deprecation warnings and database migration notices.
|
413
413
|
|
414
|
-
|
414
|
+
To perform upgrades to the GoodJob database tables:
|
415
415
|
|
416
|
-
|
417
|
-
|
418
|
-
```
|
416
|
+
1. Generate new database migration files:
|
417
|
+
|
418
|
+
```bash
|
419
|
+
bin/rails g good_job:update
|
420
|
+
```
|
421
|
+
|
422
|
+
1. Run the database migration locally
|
423
|
+
|
424
|
+
```bash
|
425
|
+
bin/rails db:migrate
|
426
|
+
```
|
427
|
+
|
428
|
+
1. Commit the migration files and resulting `db/schema.rb` changes.
|
429
|
+
1. Deploy the code, run the migrations against the production database, and restart server/worker processes.
|
430
|
+
|
431
|
+
#### Upgrading v1 to v2
|
432
|
+
|
433
|
+
GoodJob v2 introduces a new Advisory Lock key format that is different than the v1 advisory lock key format; it's therefore necessary to perform a simple, but staged production upgrade. If you are already using `>= v1.12+` no other changes are likely44
|
434
|
+
necessary.
|
435
|
+
|
436
|
+
1. Upgrade your production environment to `v1.99.x` following the minor version upgrade process, including database migrations. `v1.99` is a transitional release that is safely compatible with both `v1.x` and `v2.0.0` because it uses both `v1`- and `v2`-formatted advisory locks.
|
437
|
+
1. Address any deprecation warnings generated by `v1.99`.
|
438
|
+
1. Upgrade your production environment to `v1.99.x` to `v2.0.x` again following the _minor_ upgrade process.
|
439
|
+
|
440
|
+
Notable changes:
|
441
|
+
|
442
|
+
- Renames `:async_server` execution mode to `:async`; renames prior `:async` execution mode to `:async_all`.
|
443
|
+
- Sets default Development environment's execution mode to `:async` with disabled polling.
|
444
|
+
- Triggers `GoodJob.on_thread_error` for unhandled ActiveJob exceptions.
|
445
|
+
- Renames `GoodJob.reperform_jobs_on_standard_error` accessor to `GoodJob.retry_on_unhandled_error`.
|
446
|
+
- Renames `GoodJob::Adapter.shutdown(wait:)` argument to `GoodJob::Adapter.shutdown(timeout:)`.
|
447
|
+
- Changes Advisory Lock key format from `good_jobs[ROW_ID]` to `good_jobs-[ACTIVE_JOB_ID]`.
|
448
|
+
- Expects presence of columns `good_jobs.active_job_id`, `good_jobs.concurrency_key`, `good_jobs.concurrency_key`, and `good_jobs.retried_good_job_id`.
|
419
449
|
|
420
450
|
## Go deeper
|
421
451
|
|
data/lib/good_job/job.rb
CHANGED
@@ -189,7 +189,13 @@ module GoodJob
|
|
189
189
|
break if good_job.blank?
|
190
190
|
break :unlocked unless good_job&.executable?
|
191
191
|
|
192
|
-
|
192
|
+
begin
|
193
|
+
good_job.with_advisory_lock(key: "good_jobs-#{good_job.active_job_id}") do
|
194
|
+
good_job.perform
|
195
|
+
end
|
196
|
+
rescue RecordAlreadyAdvisoryLockedError => e
|
197
|
+
ExecutionResult.new(value: nil, handled_error: e)
|
198
|
+
end
|
193
199
|
end
|
194
200
|
end
|
195
201
|
|
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: 1.
|
4
|
+
version: 1.99.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sheldon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|