activejob 6.0.0.beta1 → 6.0.0.beta2
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 +5 -0
- data/lib/active_job/core.rb +6 -1
- data/lib/active_job/enqueuing.rb +1 -1
- data/lib/active_job/gem_version.rb +1 -1
- data/lib/active_job/logging.rb +1 -1
- data/lib/active_job/queue_name.rb +20 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1629bb05f41e9fa8d313f89099f5d798eb2753303857597ebbd8dbefb6c2e0d7
|
4
|
+
data.tar.gz: 44a9a73bbdf05b621858b5a4cd2e4e1f59be579a984fe5f7dbb2517f140392dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6ff844405408632c22be01751e99824849752bc6188712d96ffe43e5c61818f1425a9cd3ecce08b31d8dfec8aa6f657c6c11237058fe74485786029504d1091
|
7
|
+
data.tar.gz: c993fbbb37c36a67690927c1ae387bd5e6ff8de9b43ca8757c1c5167834424dfd3c7f801f70594e194949d74f66028be0e5846e28e959279e250c668c549351f
|
data/CHANGELOG.md
CHANGED
data/lib/active_job/core.rb
CHANGED
@@ -40,6 +40,9 @@ module ActiveJob
|
|
40
40
|
# Timezone to be used during the job.
|
41
41
|
attr_accessor :timezone
|
42
42
|
|
43
|
+
# Track when a job was enqueued
|
44
|
+
attr_accessor :enqueued_at
|
45
|
+
|
43
46
|
# These methods will be included into any Active Job object, adding
|
44
47
|
# helpers for de/serialization and creation of job instances.
|
45
48
|
module ClassMethods
|
@@ -97,7 +100,8 @@ module ActiveJob
|
|
97
100
|
"executions" => executions,
|
98
101
|
"exception_executions" => exception_executions,
|
99
102
|
"locale" => I18n.locale.to_s,
|
100
|
-
"timezone" => Time.zone.try(:name)
|
103
|
+
"timezone" => Time.zone.try(:name),
|
104
|
+
"enqueued_at" => Time.now.utc.iso8601
|
101
105
|
}
|
102
106
|
end
|
103
107
|
|
@@ -137,6 +141,7 @@ module ActiveJob
|
|
137
141
|
self.exception_executions = job_data["exception_executions"]
|
138
142
|
self.locale = job_data["locale"] || I18n.locale.to_s
|
139
143
|
self.timezone = job_data["timezone"] || Time.zone.try(:name)
|
144
|
+
self.enqueued_at = job_data["enqueued_at"]
|
140
145
|
end
|
141
146
|
|
142
147
|
private
|
data/lib/active_job/enqueuing.rb
CHANGED
@@ -67,7 +67,7 @@ module ActiveJob
|
|
67
67
|
false
|
68
68
|
else
|
69
69
|
ActiveSupport::Deprecation.warn(
|
70
|
-
"Rails 6.0 will return false when the
|
70
|
+
"Rails 6.0 will return false when the enqueuing is aborted. Make sure your code doesn't depend on it" \
|
71
71
|
" returning the instance of the job and set `config.active_job.return_false_on_aborted_enqueue = true`" \
|
72
72
|
" to remove the deprecations."
|
73
73
|
)
|
data/lib/active_job/logging.rb
CHANGED
@@ -70,7 +70,7 @@ module ActiveJob
|
|
70
70
|
def perform_start(event)
|
71
71
|
info do
|
72
72
|
job = event.payload[:job]
|
73
|
-
"Performing #{job.class.name} (Job ID: #{job.job_id}) from #{queue_name(event)}" + args_info(job)
|
73
|
+
"Performing #{job.class.name} (Job ID: #{job.job_id}) from #{queue_name(event)} enqueued at #{job.enqueued_at}" + args_info(job)
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -18,6 +18,26 @@ module ActiveJob
|
|
18
18
|
# post.to_feed!
|
19
19
|
# end
|
20
20
|
# end
|
21
|
+
#
|
22
|
+
# Can be given a block that will evaluate in the context of the job
|
23
|
+
# allowing +self.arguments+ to be accessed so that a dynamic queue name
|
24
|
+
# can be applied:
|
25
|
+
#
|
26
|
+
# class PublishToFeedJob < ApplicationJob
|
27
|
+
# queue_as do
|
28
|
+
# post = self.arguments.first
|
29
|
+
#
|
30
|
+
# if post.paid?
|
31
|
+
# :paid_feeds
|
32
|
+
# else
|
33
|
+
# :feeds
|
34
|
+
# end
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# def perform(post)
|
38
|
+
# post.to_feed!
|
39
|
+
# end
|
40
|
+
# end
|
21
41
|
def queue_as(part_name = nil, &block)
|
22
42
|
if block_given?
|
23
43
|
self.queue_name = block
|
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: 6.0.0.
|
4
|
+
version: 6.0.0.beta2
|
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: 2019-
|
11
|
+
date: 2019-02-25 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: 6.0.0.
|
19
|
+
version: 6.0.0.beta2
|
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: 6.0.0.
|
26
|
+
version: 6.0.0.beta2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: globalid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,8 +94,8 @@ homepage: http://rubyonrails.org
|
|
94
94
|
licenses:
|
95
95
|
- MIT
|
96
96
|
metadata:
|
97
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.0.
|
98
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.0.
|
97
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.0.beta2/activejob
|
98
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.0.beta2/activejob/CHANGELOG.md
|
99
99
|
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|