delayed_job 4.1.8 → 4.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -6
- data/README.md +13 -9
- data/delayed_job.gemspec +7 -2
- data/lib/delayed/worker.rb +1 -0
- data/lib/delayed_job.rb +1 -0
- data/spec/helper.rb +26 -7
- data/spec/performable_mailer_spec.rb +26 -0
- data/spec/yaml_ext_spec.rb +1 -1
- metadata +22 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5abe29ddb94836277901e7d618f7291ff9078ca25619b40405a3ccc5a471950
|
4
|
+
data.tar.gz: fb35d6e6eb7618ba31e44e31580c369aa80fe90353bbc282cf933613c82d152c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5427056c3a1adcd9a484a2eeec2d2ce6f3b2ad4c845f31a98d917a3ac228ee0c58a9ca7ced028b03a7935704dceaf6419ee71a4f7077287e7b39429dc517abd1
|
7
|
+
data.tar.gz: '082c6fa5d5407d3e87c2393f16c2dfdb233f12a2012bc28d03a1baca749d0d95ca8263d7ed67796561ab1376fe1fa7963af57c87fc06b362d6c1dffc07bc6b98'
|
data/CHANGELOG.md
CHANGED
@@ -1,29 +1,42 @@
|
|
1
|
+
4.1.11 - 2022-09-28
|
2
|
+
===================
|
3
|
+
* Fix missing require for Rails 7.0.3+
|
4
|
+
|
5
|
+
4.1.10 - 2022-01-17
|
6
|
+
===================
|
7
|
+
* Support for Rails 7.0. NOTE: If you are using Delayed Job independent of Rails, Active Support 7 has dropped classic dependency autoloading. You will need to add and setup zeitwerk for autoloading to continue working in ActiveSupport 7.
|
8
|
+
|
9
|
+
4.1.9 - 2020-12-09
|
10
|
+
==================
|
11
|
+
* Support for Rails 6.1
|
12
|
+
* Add support for parameterized mailers via delay call (#1121)
|
13
|
+
|
1
14
|
4.1.8 - 2019-08-16
|
2
|
-
|
15
|
+
==================
|
3
16
|
* Support for Rails 6.0.0
|
4
17
|
|
5
18
|
4.1.7 - 2019-06-20
|
6
|
-
|
19
|
+
==================
|
7
20
|
* Fix loading Delayed::PerformableMailer when ActionMailer isn't loaded yet
|
8
21
|
|
9
22
|
4.1.6 - 2019-06-19
|
10
|
-
|
23
|
+
==================
|
11
24
|
* Properly initialize ActionMailer outside railties (#1077)
|
12
25
|
* Fix Psych load_tags support (#1093)
|
13
26
|
* Replace REMOVED with FAILED in log message (#1048)
|
14
27
|
* Misc doc updates (#1052, #1074, #1064, #1063)
|
15
28
|
|
16
29
|
4.1.5 - 2018-04-13
|
17
|
-
|
30
|
+
==================
|
18
31
|
* Allow Rails 5.2
|
19
32
|
|
20
33
|
4.1.4 - 2017-12-29
|
21
|
-
|
34
|
+
==================
|
22
35
|
* Use `yaml_tag` instead of deprecated `yaml_as` (#996)
|
23
36
|
* Support ruby 2.5.0
|
24
37
|
|
25
38
|
4.1.3 - 2017-05-26
|
26
|
-
|
39
|
+
==================
|
27
40
|
* Don't mutate the options hash (#877)
|
28
41
|
* Log an error message when a deserialization error occurs (#894)
|
29
42
|
* Adding the queue name to the log output (#917)
|
data/README.md
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
**If you're viewing this at https://github.com/collectiveidea/delayed_job,
|
2
2
|
you're reading the documentation for the master branch.
|
3
3
|
[View documentation for the latest release
|
4
|
-
(4.1.
|
4
|
+
(4.1.11).](https://github.com/collectiveidea/delayed_job/tree/v4.1.11)**
|
5
5
|
|
6
6
|
Delayed::Job
|
7
7
|
============
|
8
8
|
[![Gem Version](https://badge.fury.io/rb/delayed_job.svg)][gem]
|
9
|
-
|
9
|
+
![CI](https://github.com/collectiveidea/delayed_job/workflows/CI/badge.svg)
|
10
10
|
[![Code Climate](https://codeclimate.com/github/collectiveidea/delayed_job.svg)][codeclimate]
|
11
11
|
[![Coverage Status](https://coveralls.io/repos/collectiveidea/delayed_job/badge.svg?branch=master)][coveralls]
|
12
12
|
|
13
13
|
[gem]: https://rubygems.org/gems/delayed_job
|
14
|
-
[travis]: https://travis-ci.org/collectiveidea/delayed_job
|
15
14
|
[codeclimate]: https://codeclimate.com/github/collectiveidea/delayed_job
|
16
15
|
[coveralls]: https://coveralls.io/r/collectiveidea/delayed_job
|
17
16
|
|
@@ -168,9 +167,10 @@ end
|
|
168
167
|
|
169
168
|
If you ever want to call a `handle_asynchronously`'d method without Delayed Job, for instance while debugging something at the console, just add `_without_delay` to the method name. For instance, if your original method was `foo`, then call `foo_without_delay`.
|
170
169
|
|
171
|
-
Rails
|
172
|
-
|
173
|
-
|
170
|
+
Rails Mailers
|
171
|
+
=============
|
172
|
+
Delayed Job uses special syntax for Rails Mailers.
|
173
|
+
Do not call the `.deliver` method when using `.delay`.
|
174
174
|
|
175
175
|
```ruby
|
176
176
|
# without delayed_job
|
@@ -179,12 +179,16 @@ Notifier.signup(@user).deliver
|
|
179
179
|
# with delayed_job
|
180
180
|
Notifier.delay.signup(@user)
|
181
181
|
|
182
|
-
#
|
182
|
+
# delayed_job running at a specific time
|
183
183
|
Notifier.delay(run_at: 5.minutes.from_now).signup(@user)
|
184
|
+
|
185
|
+
# when using parameters, the .with method must be called before the .delay method
|
186
|
+
Notifier.with(foo: 1, bar: 2).delay.signup(@user)
|
184
187
|
```
|
185
188
|
|
186
|
-
|
187
|
-
|
189
|
+
You may also wish to consider using
|
190
|
+
[Active Job with Action Mailer](https://edgeguides.rubyonrails.org/active_job_basics.html#action-mailer)
|
191
|
+
which provides convenient `.deliver_later` syntax that forwards to Delayed Job under-the-hood.
|
188
192
|
|
189
193
|
Named Queues
|
190
194
|
============
|
data/delayed_job.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
|
-
spec.add_dependency 'activesupport', ['>= 3.0', '<
|
4
|
+
spec.add_dependency 'activesupport', ['>= 3.0', '< 8.0']
|
5
5
|
spec.authors = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke']
|
6
6
|
spec.description = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.'
|
7
7
|
spec.email = ['brian@collectiveidea.com']
|
@@ -13,5 +13,10 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.require_paths = ['lib']
|
14
14
|
spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
|
15
15
|
spec.test_files = Dir.glob('spec/**/*')
|
16
|
-
spec.version = '4.1.
|
16
|
+
spec.version = '4.1.11'
|
17
|
+
spec.metadata = {
|
18
|
+
'changelog_uri' => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md',
|
19
|
+
'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues',
|
20
|
+
'source_code_uri' => 'https://github.com/collectiveidea/delayed_job'
|
21
|
+
}
|
17
22
|
end
|
data/lib/delayed/worker.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'timeout'
|
2
2
|
require 'active_support/dependencies'
|
3
|
+
require 'active_support/core_ext/kernel/reporting'
|
3
4
|
require 'active_support/core_ext/numeric/time'
|
4
5
|
require 'active_support/core_ext/class/attribute_accessors'
|
5
6
|
require 'active_support/hash_with_indifferent_access'
|
data/lib/delayed_job.rb
CHANGED
@@ -16,6 +16,7 @@ require 'delayed/railtie' if defined?(Rails::Railtie)
|
|
16
16
|
ActiveSupport.on_load(:action_mailer) do
|
17
17
|
require 'delayed/performable_mailer'
|
18
18
|
ActionMailer::Base.extend(Delayed::DelayMail)
|
19
|
+
ActionMailer::Parameterized::Mailer.include(Delayed::DelayMail) if defined?(ActionMailer::Parameterized::Mailer)
|
19
20
|
end
|
20
21
|
|
21
22
|
module Delayed
|
data/spec/helper.rb
CHANGED
@@ -1,13 +1,19 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
require '
|
2
|
+
require 'simplecov-lcov'
|
3
3
|
|
4
|
-
SimpleCov
|
4
|
+
SimpleCov::Formatter::LcovFormatter.config do |c|
|
5
|
+
c.report_with_single_file = true
|
6
|
+
c.single_report_path = 'coverage/lcov.info'
|
7
|
+
end
|
8
|
+
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
|
9
|
+
[
|
10
|
+
SimpleCov::Formatter::HTMLFormatter,
|
11
|
+
SimpleCov::Formatter::LcovFormatter
|
12
|
+
]
|
13
|
+
)
|
5
14
|
|
6
15
|
SimpleCov.start do
|
7
16
|
add_filter '/spec/'
|
8
|
-
# Each version of ruby and version of rails test different things
|
9
|
-
# This should probably just be removed.
|
10
|
-
minimum_coverage(85.0)
|
11
17
|
end
|
12
18
|
|
13
19
|
require 'logger'
|
@@ -41,8 +47,21 @@ end
|
|
41
47
|
|
42
48
|
Delayed::Worker.backend = :test
|
43
49
|
|
44
|
-
|
45
|
-
|
50
|
+
if ActiveSupport::VERSION::MAJOR < 7
|
51
|
+
require 'active_support/dependencies'
|
52
|
+
|
53
|
+
# Add this directory so the ActiveSupport autoloading works
|
54
|
+
ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__)
|
55
|
+
else
|
56
|
+
# Rails 7 dropped classic dependency auto-loading. This does a basic
|
57
|
+
# zeitwerk setup to test against zeitwerk directly as the Rails zeitwerk
|
58
|
+
# setup is intertwined in the application boot process.
|
59
|
+
require 'zeitwerk'
|
60
|
+
|
61
|
+
loader = Zeitwerk::Loader.new
|
62
|
+
loader.push_dir File.dirname(__FILE__)
|
63
|
+
loader.setup
|
64
|
+
end
|
46
65
|
|
47
66
|
# Used to test interactions between DJ and an ORM
|
48
67
|
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
|
@@ -40,3 +40,29 @@ describe ActionMailer::Base do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
+
|
44
|
+
if defined?(ActionMailer::Parameterized::Mailer)
|
45
|
+
describe ActionMailer::Parameterized::Mailer do
|
46
|
+
describe 'delay' do
|
47
|
+
it 'enqueues a PerformableEmail job' do
|
48
|
+
expect do
|
49
|
+
job = MyMailer.with(:foo => 1, :bar => 2).delay.signup('john@example.com')
|
50
|
+
expect(job.payload_object.class).to eq(Delayed::PerformableMailer)
|
51
|
+
expect(job.payload_object.object.class).to eq(ActionMailer::Parameterized::Mailer)
|
52
|
+
expect(job.payload_object.object.instance_variable_get('@mailer')).to eq(MyMailer)
|
53
|
+
expect(job.payload_object.object.instance_variable_get('@params')).to eq(:foo => 1, :bar => 2)
|
54
|
+
expect(job.payload_object.method_name).to eq(:signup)
|
55
|
+
expect(job.payload_object.args).to eq(['john@example.com'])
|
56
|
+
end.to change { Delayed::Job.count }.by(1)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe 'delay on a mail object' do
|
61
|
+
it 'raises an exception' do
|
62
|
+
expect do
|
63
|
+
MyMailer.with(:foo => 1, :bar => 2).signup('john@example.com').delay
|
64
|
+
end.to raise_error(RuntimeError)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/spec/yaml_ext_spec.rb
CHANGED
@@ -25,7 +25,7 @@ describe 'YAML' do
|
|
25
25
|
it 'autoloads the class of an anonymous struct' do
|
26
26
|
expect do
|
27
27
|
yaml = "--- !ruby/struct\nn: 1\n"
|
28
|
-
object =
|
28
|
+
object = load_with_delayed_visitor(yaml)
|
29
29
|
expect(object).to be_kind_of(Struct)
|
30
30
|
expect(object.n).to eq(1)
|
31
31
|
end.not_to raise_error
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -12,10 +12,10 @@ authors:
|
|
12
12
|
- Matt Griffin
|
13
13
|
- Steve Richert
|
14
14
|
- Tobias Lütke
|
15
|
-
autorequire:
|
15
|
+
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date:
|
18
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activesupport
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
version: '3.0'
|
27
27
|
- - "<"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '8.0'
|
30
30
|
type: :runtime
|
31
31
|
prerelease: false
|
32
32
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
version: '3.0'
|
37
37
|
- - "<"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '8.0'
|
40
40
|
description: Delayed_job (or DJ) encapsulates the common pattern of asynchronously
|
41
41
|
executing longer tasks in the background. It is a direct extraction from Shopify
|
42
42
|
where the job table is responsible for a multitude of core tasks.
|
@@ -102,8 +102,11 @@ files:
|
|
102
102
|
homepage: http://github.com/collectiveidea/delayed_job
|
103
103
|
licenses:
|
104
104
|
- MIT
|
105
|
-
metadata:
|
106
|
-
|
105
|
+
metadata:
|
106
|
+
changelog_uri: https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md
|
107
|
+
bug_tracker_uri: https://github.com/collectiveidea/delayed_job/issues
|
108
|
+
source_code_uri: https://github.com/collectiveidea/delayed_job
|
109
|
+
post_install_message:
|
107
110
|
rdoc_options: []
|
108
111
|
require_paths:
|
109
112
|
- lib
|
@@ -118,26 +121,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
121
|
- !ruby/object:Gem::Version
|
119
122
|
version: '0'
|
120
123
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
-
signing_key:
|
124
|
+
rubygems_version: 3.3.7
|
125
|
+
signing_key:
|
123
126
|
specification_version: 4
|
124
127
|
summary: Database-backed asynchronous priority queue system -- Extracted from Shopify
|
125
128
|
test_files:
|
126
|
-
- spec/sample_jobs.rb
|
127
|
-
- spec/lifecycle_spec.rb
|
128
|
-
- spec/performable_method_spec.rb
|
129
|
-
- spec/helper.rb
|
130
|
-
- spec/psych_ext_spec.rb
|
131
|
-
- spec/worker_spec.rb
|
132
|
-
- spec/autoloaded/struct.rb
|
133
129
|
- spec/autoloaded/clazz.rb
|
134
130
|
- spec/autoloaded/instance_clazz.rb
|
135
131
|
- spec/autoloaded/instance_struct.rb
|
136
|
-
- spec/
|
137
|
-
- spec/
|
132
|
+
- spec/autoloaded/struct.rb
|
133
|
+
- spec/daemons.rb
|
138
134
|
- spec/delayed/backend/test.rb
|
139
135
|
- spec/delayed/command_spec.rb
|
136
|
+
- spec/delayed/serialization/test.rb
|
137
|
+
- spec/helper.rb
|
138
|
+
- spec/lifecycle_spec.rb
|
140
139
|
- spec/message_sending_spec.rb
|
141
140
|
- spec/performable_mailer_spec.rb
|
141
|
+
- spec/performable_method_spec.rb
|
142
|
+
- spec/psych_ext_spec.rb
|
143
|
+
- spec/sample_jobs.rb
|
144
|
+
- spec/test_backend_spec.rb
|
145
|
+
- spec/worker_spec.rb
|
142
146
|
- spec/yaml_ext_spec.rb
|
143
|
-
- spec/daemons.rb
|