activejob 5.2.0 → 5.2.1.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activejob might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b37142bf858d333078045c61fce484cb2c897bf5703ba3e436554ad5c121b28
4
- data.tar.gz: 80da58bdf3fe33c69449673111513ab5cfd60fb3808992e49377a6b5edad524e
3
+ metadata.gz: 56e0ed051fab0bb338aad0e7e2c711cc02e16735780453ac4c0c6667bef6cde0
4
+ data.tar.gz: 74eebf584043dcd44d16b79471c11d618e5a40fede93e0dc113f061a691dd4f1
5
5
  SHA512:
6
- metadata.gz: '099ea73c1d6becd7452954296e14caf364e7377f64a4a1797f20f2e5fb74fdd0afccb2875df531a89fee57ee614477cb5ff6d68841c258e37b12cc2c27f30635'
7
- data.tar.gz: 01545f591d0f2c112f3708430c0aa32f959db1e08278b196c17a085544ca76f2adec7e692d59fc9dca148e060e278422a91713e07be84b8d0eae23d5eb6d54a1
6
+ metadata.gz: 17f4cab310d256155278516934c1a8df1443757278620482bc5fb9b5d0947e4786cb73990c9865ced7b9b4b455f254d2983879671db71b9bf4affd7214c9efd7
7
+ data.tar.gz: aa25a9bd28a234095952cab17360a693f0593cdca5077705fa77899ae213c2526c65ec0576251979bc907479237b94ed3fa7c5a7bd889a80fd27df4b56d42ddb
@@ -1,3 +1,11 @@
1
+ ## Rails 5.2.1.rc1 (July 30, 2018) ##
2
+
3
+ * Pass the error instance as the second parameter of block executed by `discard_on`.
4
+
5
+ Fixes #32853.
6
+
7
+ *Yuji Yaginuma*
8
+
1
9
  ## Rails 5.2.0 (April 09, 2018) ##
2
10
 
3
11
  * Allow block to be passed to `ActiveJob::Base.discard_on` to allow custom handling of discard jobs.
@@ -85,7 +85,7 @@ module ActiveJob
85
85
  "provider_job_id" => provider_job_id,
86
86
  "queue_name" => queue_name,
87
87
  "priority" => priority,
88
- "arguments" => serialize_arguments(arguments),
88
+ "arguments" => serialize_arguments_if_needed(arguments),
89
89
  "executions" => executions,
90
90
  "locale" => I18n.locale.to_s
91
91
  }
@@ -128,19 +128,31 @@ module ActiveJob
128
128
  end
129
129
 
130
130
  private
131
+ def serialize_arguments_if_needed(arguments)
132
+ if arguments_serialized?
133
+ @serialized_arguments
134
+ else
135
+ serialize_arguments(arguments)
136
+ end
137
+ end
138
+
131
139
  def deserialize_arguments_if_needed
132
- if defined?(@serialized_arguments) && @serialized_arguments.present?
140
+ if arguments_serialized?
133
141
  @arguments = deserialize_arguments(@serialized_arguments)
134
142
  @serialized_arguments = nil
135
143
  end
136
144
  end
137
145
 
138
- def serialize_arguments(serialized_args)
139
- Arguments.serialize(serialized_args)
146
+ def serialize_arguments(arguments)
147
+ Arguments.serialize(arguments)
140
148
  end
141
149
 
142
150
  def deserialize_arguments(serialized_args)
143
151
  Arguments.deserialize(serialized_args)
144
152
  end
153
+
154
+ def arguments_serialized?
155
+ defined?(@serialized_arguments) && @serialized_arguments
156
+ end
145
157
  end
146
158
  end
@@ -30,8 +30,8 @@ module ActiveJob
30
30
  # class RemoteServiceJob < ActiveJob::Base
31
31
  # retry_on CustomAppException # defaults to 3s wait, 5 attempts
32
32
  # retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 }
33
- # retry_on(YetAnotherCustomAppException) do |job, exception|
34
- # ExceptionNotifier.caught(exception)
33
+ # retry_on(YetAnotherCustomAppException) do |job, error|
34
+ # ExceptionNotifier.caught(error)
35
35
  # end
36
36
  # retry_on ActiveRecord::Deadlocked, wait: 5.seconds, attempts: 3
37
37
  # retry_on Net::OpenTimeout, wait: :exponentially_longer, attempts: 10
@@ -67,8 +67,8 @@ module ActiveJob
67
67
  #
68
68
  # class SearchIndexingJob < ActiveJob::Base
69
69
  # discard_on ActiveJob::DeserializationError
70
- # discard_on(CustomAppException) do |job, exception|
71
- # ExceptionNotifier.caught(exception)
70
+ # discard_on(CustomAppException) do |job, error|
71
+ # ExceptionNotifier.caught(error)
72
72
  # end
73
73
  #
74
74
  # def perform(record)
@@ -79,7 +79,7 @@ module ActiveJob
79
79
  def discard_on(exception)
80
80
  rescue_from exception do |error|
81
81
  if block_given?
82
- yield self, exception
82
+ yield self, error
83
83
  else
84
84
  logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{error.cause.inspect}."
85
85
  end
@@ -9,8 +9,8 @@ module ActiveJob
9
9
  module VERSION
10
10
  MAJOR = 5
11
11
  MINOR = 2
12
- TINY = 0
13
- PRE = nil
12
+ TINY = 1
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
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: 5.2.0
4
+ version: 5.2.1.rc1
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: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-07-30 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: 5.2.0
19
+ version: 5.2.1.rc1
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: 5.2.0
26
+ version: 5.2.1.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: globalid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,8 +86,8 @@ homepage: http://rubyonrails.org
86
86
  licenses:
87
87
  - MIT
88
88
  metadata:
89
- source_code_uri: https://github.com/rails/rails/tree/v5.2.0/activejob
90
- changelog_uri: https://github.com/rails/rails/blob/v5.2.0/activejob/CHANGELOG.md
89
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.1.rc1/activejob
90
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.1.rc1/activejob/CHANGELOG.md
91
91
  post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
@@ -99,12 +99,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: 2.2.2
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - ">"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: 1.3.1
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.7.6
107
+ rubygems_version: 2.7.3
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Job framework with pluggable queues.