activejob 7.0.0 → 7.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/MIT-LICENSE +1 -1
- data/lib/active_job/gem_version.rb +1 -1
- data/lib/active_job/test_helper.rb +3 -3
- data/lib/active_job.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 943b9e02ac6352d3cefdc94020e3bc61ac959dc208a6022790b0861b400c32e1
|
4
|
+
data.tar.gz: 90cb82d17339efe5a4cb3abe10566f48fdcb983fe8c6b29422fd33bd128b2f38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a731c1d1a4af3dc7edf881b16ec4c71a6139d52955651614a43f7e53ad198782d0657b61bf8ac14ebf27a31112ea84b0a18aa89dcd161c73fbb6780308d99f5d
|
7
|
+
data.tar.gz: 5631dfff92392136050ffa785016c5afa8a163c325fff32351652d8cb6a29dc193125bf6431022c11000b6d3db1353581ac63cee1008c72680457d9b7eb338ec
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
+
## Rails 7.0.1 (January 06, 2022) ##
|
2
|
+
|
3
|
+
* Allow testing `discard_on/retry_on ActiveJob::DeserializationError`
|
4
|
+
|
5
|
+
Previously in `perform_enqueued_jobs`, `deserialize_arguments_if_needed`
|
6
|
+
was called before calling `perform_now`. When a record no longer exists
|
7
|
+
and is serialized using GlobalID this led to raising
|
8
|
+
an `ActiveJob::DeserializationError` before reaching `perform_now` call.
|
9
|
+
This behaviour makes difficult testing the job `discard_on/retry_on` logic.
|
10
|
+
|
11
|
+
Now `deserialize_arguments_if_needed` call is postponed to when `perform_now`
|
12
|
+
is called.
|
13
|
+
|
14
|
+
Example:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
class UpdateUserJob < ActiveJob::Base
|
18
|
+
discard_on ActiveJob::DeserializationError
|
19
|
+
|
20
|
+
def perform(user)
|
21
|
+
# ...
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# In the test
|
26
|
+
User.destroy_all
|
27
|
+
assert_nothing_raised do
|
28
|
+
perform_enqueued_jobs only: UpdateUserJob
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
*Jacopo Beschi*
|
33
|
+
|
34
|
+
|
1
35
|
## Rails 7.0.0 (December 15, 2021) ##
|
2
36
|
|
3
37
|
* No changes.
|
data/MIT-LICENSE
CHANGED
@@ -688,7 +688,7 @@ module ActiveJob
|
|
688
688
|
enqueued_jobs_with(only: only, except: except, queue: queue, at: at) do |payload|
|
689
689
|
queue_adapter.enqueued_jobs.delete(payload)
|
690
690
|
queue_adapter.performed_jobs << payload
|
691
|
-
instantiate_job(payload).perform_now
|
691
|
+
instantiate_job(payload, skip_deserialize_arguments: true).perform_now
|
692
692
|
end.count
|
693
693
|
end
|
694
694
|
|
@@ -708,10 +708,10 @@ module ActiveJob
|
|
708
708
|
end
|
709
709
|
end
|
710
710
|
|
711
|
-
def instantiate_job(payload)
|
711
|
+
def instantiate_job(payload, skip_deserialize_arguments: false)
|
712
712
|
job = payload[:job].deserialize(payload)
|
713
713
|
job.scheduled_at = Time.at(payload[:at]) if payload.key?(:at)
|
714
|
-
job.send(:deserialize_arguments_if_needed)
|
714
|
+
job.send(:deserialize_arguments_if_needed) unless skip_deserialize_arguments
|
715
715
|
job
|
716
716
|
end
|
717
717
|
|
data/lib/active_job.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2014-
|
4
|
+
# Copyright (c) 2014-2022 David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.0.
|
19
|
+
version: 7.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.0.
|
26
|
+
version: 7.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,10 +100,10 @@ licenses:
|
|
100
100
|
- MIT
|
101
101
|
metadata:
|
102
102
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
103
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
104
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
103
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.1/activejob/CHANGELOG.md
|
104
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.1/
|
105
105
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
106
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
106
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.1/activejob
|
107
107
|
rubygems_mfa_required: 'true'
|
108
108
|
post_install_message:
|
109
109
|
rdoc_options: []
|